Skip to content

Commit

Permalink
Better error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
aHenryJard committed Jan 28, 2025
1 parent a97077b commit 4b59b35
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion opencti-platform/opencti-graphql/src/back.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,4 @@ if (ENABLED_EVENT_LOOP_MONITORING) {
}
// -- Start the platform
// noinspection JSIgnoredPromiseFromCall
platformStart().catch((reason) => logApp.error('ERROR on platformStart', { reason }));
platformStart().catch((reason) => logApp.error('Error occurs on platformStart', { reason }));

Check warning on line 60 in opencti-platform/opencti-graphql/src/back.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/back.js#L60

Added line #L60 was not covered by tests
4 changes: 2 additions & 2 deletions opencti-platform/opencti-graphql/src/config/providers.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ for (let i = 0; i < providerKeys.length; i += 1) {
}).catch((err) => {
logApp.error('[OPENID] Error initializing authentication provider', { cause: err, provider: providerRef });
});
}).catch((reason) => logApp.error('[OPENID] Error', { cause: reason }));
}).catch((reason) => logApp.error('[OPENID] Error when enrich with remote credentials', { cause: reason }));

Check warning on line 407 in opencti-platform/opencti-graphql/src/config/providers.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/config/providers.js#L407

Added line #L407 was not covered by tests
}
if (strategy === STRATEGY_FACEBOOK) {
const providerRef = identifier || 'facebook';
Expand Down Expand Up @@ -521,7 +521,7 @@ for (let i = 0; i < providerKeys.length; i += 1) {
};
passport.use(providerRef, auth0Strategy);
providers.push({ name: providerName, type: AUTH_SSO, strategy, provider: providerRef });
}).catch((reason) => logApp.error('[AUTH0] ', { cause: reason }));
}).catch((reason) => logApp.error('[AUTH0] Error when enrich with remote credentials', { cause: reason }));

Check warning on line 524 in opencti-platform/opencti-graphql/src/config/providers.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/config/providers.js#L524

Added line #L524 was not covered by tests
}
// CERT Strategies
if (strategy === STRATEGY_CERT) {
Expand Down
4 changes: 2 additions & 2 deletions opencti-platform/opencti-graphql/src/database/migration.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,11 +131,11 @@ export const applyMigration = (context) => {
logMigration.info('[MIGRATION] Migration process completed');
resolve(state);
});
}).catch((reason) => logApp.error('[MIGRATION] error', { cause: reason }));
}).catch((reason) => logApp.error('[MIGRATION] error on load', { cause: reason }));

Check warning on line 134 in opencti-platform/opencti-graphql/src/database/migration.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/database/migration.js#L134

Added line #L134 was not covered by tests
}).then(async (state) => {
// After migration, path the current version runtime
const statusPatch = { platformVersion: PLATFORM_VERSION };
await patchAttribute(context, SYSTEM_USER, state.internal_id, ENTITY_TYPE_MIGRATION_STATUS, statusPatch);
logApp.info(`[MIGRATION] Platform version updated to ${PLATFORM_VERSION}`);
}).catch((reason) => logApp.error('[MIGRATION] error', { cause: reason }));
}).catch((reason) => logApp.error('[MIGRATION] error on current version reference update', { cause: reason }));

Check warning on line 140 in opencti-platform/opencti-graphql/src/database/migration.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/database/migration.js#L140

Added line #L140 was not covered by tests
};
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ class RedisStore extends Store {
this._getAllKeys((err, keys) => {
if (err) return cb(err);
return cb(null, keys.length);
}).catch((err) => logApp.error('ERROR', { cause: err }));
}).catch((err) => logApp.error('[REDIS] Error on get all keys', { cause: err }));

Check warning on line 95 in opencti-platform/opencti-graphql/src/database/sessionStore-redis.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/database/sessionStore-redis.js#L95

Added line #L95 was not covered by tests
}

expiration(sid, cb = noop) {
const key = this.prefix + sid;
getSessionTtl(key).then((ttl) => cb(null, ttl)).catch((err) => logApp.error('ERROR', { cause: err }));
getSessionTtl(key).then((ttl) => cb(null, ttl)).catch((err) => logApp.error('[REDIS] Error on get session TTL', { cause: err }));

Check warning on line 100 in opencti-platform/opencti-graphql/src/database/sessionStore-redis.js

View check run for this annotation

Codecov / codecov/patch

opencti-platform/opencti-graphql/src/database/sessionStore-redis.js#L100

Added line #L100 was not covered by tests
}

_getAllKeys(cb = noop) {
Expand Down

0 comments on commit 4b59b35

Please sign in to comment.