mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-09-26 15:01:32 +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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user