Commit c54c9c4e authored by Diego Molteni's avatar Diego Molteni
Browse files

feat: silent error for probes

parent 22d8d3b2
Pipeline #76276 passed with stages
in 3 minutes and 31 seconds
......@@ -139,6 +139,10 @@ export class Server {
}
}
// disable silent error logs
res.locals['disabled_error_logs'] = req.query['silent'] ?
req.query['silent'] === 'silent_for_errors' : false;
// If required, exchange the caller credentials to include the DE target audience
if (Config.ENABLE_DE_TOKEN_EXCHANGE) {
if (Config.DES_TARGET_AUDIENCE) {
......
......@@ -32,12 +32,12 @@ export class Response {
err.error.code : typeof (err.code) === 'number' ? err.code : 500;
const message = typeof (err.error) === 'object' && typeof (err.error.message) === 'string' ?
err.error.message : typeof (err.message) === 'string' ? err.message : err;
if (FeatureFlags.isEnabled(Feature.LOGGING)) {
if (FeatureFlags.isEnabled(Feature.LOGGING) && res.locals['disabled_error_logs'] !== true ) {
LoggerFactory.build(Config.CLOUDPROVIDER).error(JSON.stringify(err));
}
this.write(res, code < 100 ? 500 : code, message);
} else {
if (FeatureFlags.isEnabled(Feature.LOGGING)) {
if (FeatureFlags.isEnabled(Feature.LOGGING) && res.locals['disabled_error_logs'] !== true) {
LoggerFactory.build(Config.CLOUDPROVIDER).error('Unexpected Error');
}
this.write(res, 500, 'Internal Server Error');
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment