mirror of
https://github.com/denoland/deno.git
synced 2024-12-29 10:39:10 -05:00
e3eae662f3
This commit adds "Deno.core.setFormatExceptionCallback" which can be used to provide custom formatting for errors. It is useful in cases when user throws something that is non-Error (eg. a string, plain object, etc).
15 lines
569 B
Text
15 lines
569 B
Text
[WILDCARD]
|
|
error: Uncaught Error: foo
|
|
throw new Error("foo", { cause: new Error("bar", { cause: "deno" as any }) });
|
|
^
|
|
at a (file:///[WILDCARD]/error_cause.ts:3:9)
|
|
at b (file:///[WILDCARD]/error_cause.ts:7:3)
|
|
at c (file:///[WILDCARD]/error_cause.ts:11:3)
|
|
at file:///[WILDCARD]/error_cause.ts:14:1
|
|
Caused by: Error: bar
|
|
at a (file:///[WILDCARD]/error_cause.ts:3:35)
|
|
at b (file:///[WILDCARD]/error_cause.ts:7:3)
|
|
at c (file:///[WILDCARD]/error_cause.ts:11:3)
|
|
at file:///[WILDCARD]/error_cause.ts:14:1
|
|
Caused by: "deno"
|
|
[WILDCARD]
|