summaryrefslogtreecommitdiff
path: root/cli/tests/error_022_stack_custom_error.ts
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2020-04-19 14:17:22 +0100
committerGitHub <noreply@github.com>2020-04-19 15:17:22 +0200
commit4e3532fe7b61a1050b00611081cc83af8b02de70 (patch)
treee5e9d00b13b17802e1d45497567c53467ff5bc3e /cli/tests/error_022_stack_custom_error.ts
parent5292d24e6fba2fbc17ee9a245677d5b145260784 (diff)
fix(core/js_errors): Get error's name and message from JS fields (#4808)
Diffstat (limited to 'cli/tests/error_022_stack_custom_error.ts')
-rw-r--r--cli/tests/error_022_stack_custom_error.ts10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli/tests/error_022_stack_custom_error.ts b/cli/tests/error_022_stack_custom_error.ts
index 6f3c1b0bd..b95743503 100644
--- a/cli/tests/error_022_stack_custom_error.ts
+++ b/cli/tests/error_022_stack_custom_error.ts
@@ -1,10 +1,14 @@
class CustomError extends Error {
- constructor(message: string) {
- super(message);
+ constructor() {
+ super();
this.name = "CustomError";
}
+
+ get message(): string {
+ return "custom error";
+ }
}
-const error = new CustomError("custom error");
+const error = new CustomError();
console.log(error.stack);
throw error;