mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-27 15:31:33 +08:00
chore(utils/safeExtractMessageAndStackFromError): add explicit return type to have it as a named tuple
This commit is contained in:
parent
c2aae45456
commit
2a5ac80c05
@ -363,7 +363,7 @@ export function processStringOrBuffer(data: string | Buffer | null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function safeExtractMessageAndStackFromError(err: unknown) {
|
export function safeExtractMessageAndStackFromError(err: unknown): [errMessage: string, errStack: string | undefined] {
|
||||||
return (err instanceof Error) ? [err.message, err.stack] as const : ["Unknown Error", undefined] as const;
|
return (err instanceof Error) ? [err.message, err.stack] as const : ["Unknown Error", undefined] as const;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user