Reputation: 1518
I have a situation where I need to throw an error. The error must match FirebaseError interface.
I tried to import this interface
import { FirebaseError } from '@firebase/util';
But I don't know how to use it
throw new FirebaseError ???
Upvotes: 1
Views: 337
Reputation: 13327
FirebaseError
is an interface. You should create your custom error class that extends from FirebaseError
and throw it:
class FirebaseSignInError extends FirebaseError {
}
After that, just call:
throw new FirebaseSignInError
Upvotes: 3