mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Throw error instead of returning it
This commit is contained in:
parent
7bb7189c6a
commit
ac7108b882
@ -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 New Issue
Block a user