mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +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:
|
* Finish a registration stage, return value is:
|
||||||
* - the next stage if this stage was completed successfully
|
* - the next stage if this stage was completed successfully
|
||||||
* - user-id (string) if registration is completed
|
* - 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) {
|
setNextStage(stage: BaseRegistrationStage) {
|
||||||
this._nextStage = stage;
|
this._nextStage = stage;
|
||||||
@ -65,6 +64,6 @@ export abstract class BaseRegistrationStage {
|
|||||||
return this._nextStage;
|
return this._nextStage;
|
||||||
}
|
}
|
||||||
const error = response.error ?? "Could not parse response";
|
const error = response.error ?? "Could not parse response";
|
||||||
return new Error(error);
|
throw new Error(error);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user