mirror of
https://github.com/denoland/deno.git
synced 2024-12-27 01:29:14 -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).
23 lines
317 B
TypeScript
23 lines
317 B
TypeScript
Deno.test("foo", () => {
|
|
throw undefined;
|
|
});
|
|
|
|
Deno.test("bar", () => {
|
|
throw null;
|
|
});
|
|
|
|
Deno.test("baz", () => {
|
|
throw 123;
|
|
});
|
|
|
|
Deno.test("qux", () => {
|
|
throw "Hello, world!";
|
|
});
|
|
|
|
Deno.test("quux", () => {
|
|
throw [1, 2, 3];
|
|
});
|
|
|
|
Deno.test("quuz", () => {
|
|
throw { a: "Hello, world!", b: [1, 2, 3] };
|
|
});
|