utils/axios: use captureMessage
This commit is contained in:
parent
a47e08a286
commit
0109061a84
@ -1,4 +1,4 @@
|
||||
import { captureException, captureMessage, withScope } from '@sentry/nextjs';
|
||||
import { captureMessage, withScope } from '@sentry/nextjs';
|
||||
import type { AxiosError } from 'axios';
|
||||
import { isAxiosError } from 'axios';
|
||||
import { pick } from 'radash';
|
||||
@ -28,8 +28,7 @@ export async function withHandleError<T>(fn: Promise<T>) {
|
||||
(Object.keys(opts) as Array<keyof typeof opts>).forEach((key) => {
|
||||
scope.setExtra(key, JSON.stringify(opts[key]));
|
||||
});
|
||||
captureMessage(message);
|
||||
captureException(error_);
|
||||
captureMessage(`${error_.message} | ${message}`);
|
||||
});
|
||||
|
||||
throw new Error(message);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user