chore(utils/safeExtractMessageAndStackFromError): add explicit return type to have it as a named tuple

This commit is contained in:
Panagiotis Papadopoulos 2025-03-10 08:12:07 +01:00
parent c2aae45456
commit 2a5ac80c05

View File

@ -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;
}