Handle missing stacks
This commit is contained in:
parent
05b9f834cf
commit
b66972e884
1 changed files with 1 additions and 1 deletions
|
@ -34,7 +34,7 @@ const messageWithError = (message: string, e?: unknown) => {
|
|||
if (e instanceof Error) {
|
||||
// In practice, we expect ourselves to be called with Error objects, so
|
||||
// this is the happy path so to say.
|
||||
es = `${e.name}: ${e.message}\n${e.stack}`;
|
||||
es = [`${e.name}: ${e.message}`, e.stack].filter((x) => x).join("\n");
|
||||
} else {
|
||||
// For the rest rare cases, use the default string serialization of e.
|
||||
es = String(e);
|
||||
|
|
Loading…
Add table
Reference in a new issue