Skip to content

Commit

Permalink
sentry issue fix (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
DhivaharM authored and sethk4783 committed Nov 14, 2024
1 parent 1fc32ac commit 962cf6b
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions src/lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,14 @@ export class Client extends EventEmitter {
/* istanbul ignore next */
upload.on('error', e => {
if (this.forwardErrors) {
Sentry.setTag('filestack-apikey', this.session.apikey);
Sentry.setTag('filestack-version', Utils.getVersion());
Sentry.setExtra('filestack-options', this.options);
Sentry.setExtras({ uploadOptions: options, storeOptions, details: e.details });
e.message = `FS-${e.message}`;
Sentry.captureException(e);
Sentry.withScope(scope => {
scope.setTag('filestack-apikey', this.session.apikey);
scope.setTag('filestack-version', Utils.getVersion());
scope.setExtra('filestack-options', this.options);
scope.setExtras({ uploadOptions: options, storeOptions, details: e.details });
e.message = `FS-${e.message}`;
scope.captureException(e);
});
}

this.emit('upload.error', e);
Expand Down Expand Up @@ -523,11 +525,15 @@ export class Client extends EventEmitter {
upload.on('start', () => this.emit('upload.start'));
/* istanbul ignore next */
upload.on('error', e => {
Sentry.setTag('filestack-apikey', this.session.apikey);
Sentry.setTag('filestack-version', Utils.getVersion());
Sentry.setExtra('filestack-options', this.options);
Sentry.setExtras({ uploadOptions: options, storeOptions, details: e.details });
Sentry.captureException(e);
Sentry.withScope(scope => {
scope.setTag('filestack-apikey', this.session.apikey);
scope.setTag('filestack-version', Utils.getVersion());
scope.setExtra('filestack-options', this.options);
scope.setExtras(e.details);
scope.setExtras({ uploadOptions: options, storeOptions });
scope.captureException(e);
});

this.emit('upload.error', e);
});

Expand Down

0 comments on commit 962cf6b

Please sign in to comment.