Merge pull request #5076 from betagouv/fix-file-upload-error-stacktraces
This commit is contained in:
commit
d927118221
1 changed files with 10 additions and 0 deletions
|
@ -20,9 +20,19 @@ export const FAILURE_CONNECTIVITY = 'file-upload-failure-connectivity';
|
||||||
export default class FileUploadError extends Error {
|
export default class FileUploadError extends Error {
|
||||||
constructor(message, status, code) {
|
constructor(message, status, code) {
|
||||||
super(message);
|
super(message);
|
||||||
|
|
||||||
this.name = 'FileUploadError';
|
this.name = 'FileUploadError';
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.code = code;
|
this.code = code;
|
||||||
|
|
||||||
|
// Prevent the constructor stacktrace from being included.
|
||||||
|
// (it messes up with Sentry issues grouping)
|
||||||
|
if (Error.captureStackTrace) {
|
||||||
|
// V8-only
|
||||||
|
Error.captureStackTrace(this, this.constructor);
|
||||||
|
} else {
|
||||||
|
this.stack = new Error().stack;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue