diff options
Diffstat (limited to 'cli/tests/error_022_stack_custom_error.ts')
-rw-r--r-- | cli/tests/error_022_stack_custom_error.ts | 10 |
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; |