Skip to content

Commit

Permalink
Merge pull request #571 from namecheap/chore/log-user-agent-on-specif…
Browse files Browse the repository at this point in the history
…ic-error

fix(ilc-server): log user-agent on seobotstream error
  • Loading branch information
stas-nc authored Feb 29, 2024
2 parents b8a2f94 + aab8483 commit a025743
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ilc/server/tailor/error-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = function setup(tailor, errorHandlingService) {
} else {
errorHandlingService.noticeError(
new errors.TailorError({ message: `Tailor error while headers already sent ${urlPart}`, cause: err }),
{},
{ userAgent: req.headers['user-agent'] },
{ reportError: !req.ldeRelated },
);
}
Expand Down
5 changes: 4 additions & 1 deletion ilc/server/tailor/error-handler.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const errors = require('./errors');
describe('error handler', () => {
const request = {
originalUrl: 'originalUrl',
headers: {
'user-agent': 'bot',
},
};

const error = new Error('error');
Expand Down Expand Up @@ -50,7 +53,7 @@ describe('error handler', () => {
message: `Tailor error while headers already sent while processing request "${request.originalUrl}"`,
cause: error,
}),
{},
{ userAgent: 'bot' },
{ reportError: true },
]);
});
Expand Down

0 comments on commit a025743

Please sign in to comment.