mirror of
https://github.com/zadam/trilium.git
synced 2025-10-30 18:05:55 +01:00
chore(utils/safeExtractMessageAndStackFromError): add explicit return type to have it as a named tuple
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user