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 {
8383 const typeChecker = this . getTypeChecker ( ) ;
8484 const type = typeChecker . getTypeAtLocation ( node . expression ) ;
8585
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 ) $ / ) ) {
8787 this . addFailureAtNode ( node . expression , Rule . FAILURE_STRING ) ;
8888 }
8989
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { throwError } from "rxjs";
33const ob1 = throwError("Boom!");
44 ~~~~~~~ [throw-error]
55const ob2 = throwError(new Error("Boom!"));
6+ const ob3 = throwError(new DOMException("Boom!"));
67
78// There will be no signature for callback and
89// that should not effect and internal error.
Original file line number Diff line number Diff line change 11const a = () => { throw "error"; };
22 ~~~~~~~ [throw-error]
33const b = () => { throw new Error("error"); };
4+ const c = () => { throw new DOMException("error"); };
45
56[throw-error]: Passing non-Error values is forbidden
You can’t perform that action at this time.
0 commit comments