mirror of
https://github.com/Foundry376/Mailspring.git
synced 2024-11-11 18:32:20 +08:00
[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:
parent
9bdf8ae763
commit
49c6a8cdcd
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue