copy stack to AxiosError causes

This commit is contained in:
Hazelnoot 2025-05-06 21:41:38 -04:00
parent 38b1e1225c
commit 347edb107b

View file

@ -68,6 +68,10 @@ export function getErrorException(error: unknown): Error | null {
// This is the inner exception, basically
if (error.cause && !isAxiosError(error.cause)) {
if (!error.cause.stack) {
error.cause.stack = error.stack;
}
return error.cause;
}
@ -147,6 +151,10 @@ function unpackAxiosError(error: unknown): unknown {
}
if (error.cause && !isAxiosError(error.cause)) {
if (!error.cause.stack) {
error.cause.stack = error.stack;
}
return error.cause;
}