diff --git a/apps/web/utils/axios.ts b/apps/web/utils/axios.ts index d9b56bf..2e50bef 100644 --- a/apps/web/utils/axios.ts +++ b/apps/web/utils/axios.ts @@ -1,4 +1,4 @@ -import { captureException, withScope } from '@sentry/nextjs'; +import { captureException, captureMessage, withScope } from '@sentry/nextjs'; import type { AxiosError } from 'axios'; import { isAxiosError } from 'axios'; import { pick } from 'radash'; @@ -21,13 +21,14 @@ export async function withHandleError(fn: Promise) { const data = error_.config?.data; const params = error_.config?.params; - const opts = { ...err, data, params }; const message = getErrorMessage(error_); + const opts = { ...err, data, message, params }; withScope((scope) => { (Object.keys(opts) as Array).forEach((key) => { scope.setExtra(key, JSON.stringify(opts[key])); }); + captureMessage(message); captureException(error_); });