Skip to content

Commit

Permalink
Do not report optional resource errors to Sentry
Browse files Browse the repository at this point in the history
  • Loading branch information
joanniclaborde committed Feb 8, 2016
1 parent f9febad commit 2b70d5c
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions lib/page.js
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,15 @@ var Page = function( page_path, options ){
if (status == 404) {
server.logger.log(page.route + ' [' + resource.name + '] ' + error, 3);
} else {
server.logger.log(page.route + ' [' + resource.name + '] ' + error, resource.options.optional ? 1 : 0);
page.logToSentry(error, {
error: err,
resource: {name: resource.name, url: resource.resource.url},
response: resource_response ? {status: resource_response.status, body: resource_response.data} : null,
context: _.omit(context, 'resources')
});
server.logger.log(page.route + ' [' + resource.name + '] ' + error, is_optional ? 1 : 0);
if (!is_optional) {
page.logToSentry(error, {
error: err,
resource: {name: resource.name, url: resource.resource.url},
response: resource_response ? {status: resource_response.status, body: resource_response.data} : null,
context: _.omit(context, 'resources')
});
}
}

err = {status: status, error: error, message: err, resource: resource.name};
Expand Down

0 comments on commit 2b70d5c

Please sign in to comment.