-
-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rxjs-throw-error option to specifiy error names #64
Comments
Subclassing I'll give some thought to adding an option to make it a little more flexible. |
Good to know. For what it's worth, me throwing |
I've also come across this. |
|
I've never implemented a ts-lint rule or used the typescript compiler api, so forgive me if this is dumb. interface Error {
name: string;
message: string;
stack?: string;
} Could you use this approach to check if the object implements this? |
Not easily. The check is done here and that function has only the type - it does not have the declarations: const baseTypes = type.getBaseTypes();
if (!baseTypes) {
return false;
}
return baseTypes.some(t => couldBeType(t, name, qualified)); I imagine that implemented interfaces are not included in what's returned from |
@NickLydon It's possible that this issue will be resolved with the changes in 4.29.2 - as that release includes an update to |
I have in an Angular project warnings for
rxjs-throw-error
on code like this.I have worked with subclassing Error on other projects before as well.
Would you consider a PR adding an option to set error names.
eg.
The text was updated successfully, but these errors were encountered: