File tree Expand file tree Collapse file tree 3 files changed +3
-1
lines changed
test/v6/fixtures/throw-error Expand file tree Collapse file tree 3 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ export class Walker extends Lint.ProgramAwareRuleWalker {
83
83
const typeChecker = this . getTypeChecker ( ) ;
84
84
const type = typeChecker . getTypeAtLocation ( node . expression ) ;
85
85
86
- if ( ! isAny ( type ) && ! couldBeType ( type , " Error" ) ) {
86
+ if ( ! isAny ( type ) && ! couldBeType ( type , / ^ ( E r r o r | D O M E x c e p t i o n ) $ / ) ) {
87
87
this . addFailureAtNode ( node . expression , Rule . FAILURE_STRING ) ;
88
88
}
89
89
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { throwError } from "rxjs";
3
3
const ob1 = throwError("Boom!");
4
4
~~~~~~~ [throw-error]
5
5
const ob2 = throwError(new Error("Boom!"));
6
+ const ob3 = throwError(new DOMException("Boom!"));
6
7
7
8
// There will be no signature for callback and
8
9
// that should not effect and internal error.
Original file line number Diff line number Diff line change 1
1
const a = () => { throw "error"; };
2
2
~~~~~~~ [throw-error]
3
3
const b = () => { throw new Error("error"); };
4
+ const c = () => { throw new DOMException("error"); };
4
5
5
6
[throw-error]: Passing non-Error values is forbidden
You can’t perform that action at this time.
0 commit comments