mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
copy stack to AxiosError causes
This commit is contained in:
parent
38b1e1225c
commit
347edb107b
1 changed files with 8 additions and 0 deletions
|
@ -68,6 +68,10 @@ export function getErrorException(error: unknown): Error | null {
|
||||||
|
|
||||||
// This is the inner exception, basically
|
// This is the inner exception, basically
|
||||||
if (error.cause && !isAxiosError(error.cause)) {
|
if (error.cause && !isAxiosError(error.cause)) {
|
||||||
|
if (!error.cause.stack) {
|
||||||
|
error.cause.stack = error.stack;
|
||||||
|
}
|
||||||
|
|
||||||
return error.cause;
|
return error.cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,6 +151,10 @@ function unpackAxiosError(error: unknown): unknown {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (error.cause && !isAxiosError(error.cause)) {
|
if (error.cause && !isAxiosError(error.cause)) {
|
||||||
|
if (!error.cause.stack) {
|
||||||
|
error.cause.stack = error.stack;
|
||||||
|
}
|
||||||
|
|
||||||
return error.cause;
|
return error.cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue