utils/axios: extend error.exception message
This commit is contained in:
parent
a9589f09e5
commit
0ea8c23c81
@ -24,13 +24,15 @@ export async function withHandleError<T>(fn: Promise<T>) {
|
||||
const message = getErrorMessage(error_);
|
||||
const opts = { ...err, data, message, params };
|
||||
|
||||
error_.message += ` | ${message}`;
|
||||
|
||||
withScope((scope) => {
|
||||
(Object.keys(opts) as Array<keyof typeof opts>).forEach((key) => {
|
||||
let extra = opts[key];
|
||||
if (key === 'data') extra = JSON.stringify(extra);
|
||||
scope.setExtra(key, extra);
|
||||
});
|
||||
captureException(`${error_.message} | ${message}`);
|
||||
captureException(error_);
|
||||
});
|
||||
|
||||
throw new Error(message);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user