forked from mystiq/hydrogen-web
Throw error instead of returning it
This commit is contained in:
parent
7bb7189c6a
commit
ac7108b882
1 changed files with 3 additions and 4 deletions
|
@ -48,9 +48,8 @@ export abstract class BaseRegistrationStage {
|
|||
* Finish a registration stage, return value is:
|
||||
* - the next stage if this stage was completed successfully
|
||||
* - user-id (string) if registration is completed
|
||||
* - an error if something went wrong
|
||||
*/
|
||||
abstract complete(auth?: Auth): Promise<BaseRegistrationStage | Error | string>;
|
||||
abstract complete(auth?: Auth): Promise<BaseRegistrationStage | string>;
|
||||
|
||||
setNextStage(stage: BaseRegistrationStage) {
|
||||
this._nextStage = stage;
|
||||
|
@ -65,6 +64,6 @@ export abstract class BaseRegistrationStage {
|
|||
return this._nextStage;
|
||||
}
|
||||
const error = response.error ?? "Could not parse response";
|
||||
return new Error(error);
|
||||
}
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue