diff --git a/src/matrix/registration/stages/BaseRegistrationStage.ts b/src/matrix/registration/stages/BaseRegistrationStage.ts index 6ffd9187..df23c429 100644 --- a/src/matrix/registration/stages/BaseRegistrationStage.ts +++ b/src/matrix/registration/stages/BaseRegistrationStage.ts @@ -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; + abstract complete(auth?: Auth): Promise; 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); + } }