I'm working on setting up Sentry in a React application and extending the FetchTransport to add a metric on the response of the request sentry.io. Debugging through the application shows my promise being invoked twice for each sendEvent call of the transport. A simplified version of my transport that still displays this is as follows:
import * as Sentry from '@sentry/browser';
export class WrappedFetchTransport extends Sentry.Transports.FetchTransport {
public sendEvent(event: Sentry.Event): PromiseLike<Sentry.Response> {
const promise = super.sendEvent(event);
promise.then(
(resp: any) => {
console.log(resp);
},
(reason: any) => {
console.log("error");
}
);
return promise;
}
}
Package + Version
@sentry/browser@sentry/noderaven-jsraven-node(raven for node)Version:
Description
I'm working on setting up Sentry in a React application and extending the FetchTransport to add a metric on the response of the request sentry.io. Debugging through the application shows my promise being invoked twice for each sendEvent call of the transport. A simplified version of my transport that still displays this is as follows: