[client-app] Differentiate APIError by URL also

Summary:
We have a bunch of different endpoints and it'd be helpful to know which
endpoints are failing, not just which status codes are being thrown. e.g. while
trying to reproduce send failures, I've been able to cause /auth to fail with a
504, but I couldn't tell which endpoint was failing with the 504 until I added
this extra differentiator.

Test Plan: manual

Reviewers: mark, juan

Reviewed By: mark, juan

Differential Revision: https://phab.nylas.com/D4128
This commit is contained in:
Christine Spang 2017-03-07 17:35:38 -08:00
parent 9bdf8ae763
commit 49c6a8cdcd

View file

@ -125,11 +125,11 @@ export default class NylasAPIRequest {
const {statusCode} = apiError
if (!ignorableStatusCodes.includes(statusCode)) {
const msg = apiError.message || `Unknown Error: ${apiError}`
const fingerprint = ["{{ default }}", "api error", apiError.statusCode, msg];
const fingerprint = ["{{ default }}", "api error", this.options.url, apiError.statusCode, msg];
NylasEnv.reportError(apiError, {fingerprint,
rateLimit: {
ratePerHour: 30,
key: `APIError:${statusCode}:${msg}`,
key: `APIError:${this.options.url}:${statusCode}:${msg}`,
},
});
apiError.reported = true