1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Give a better error message

if the HS doesn't support msisdn registeration
This commit is contained in:
David Baker
2017-03-15 14:14:04 +00:00
parent 8b4b0e0d39
commit a8a7d327ff

View File

@@ -334,6 +334,13 @@ InteractiveAuth.prototype = {
*/
_chooseStage: function() {
const flow = this._chooseFlow();
if (!flow) {
// XXX: This happens to be the only way this can fail right now, but
// in general this is not really going to be an accurate error message.
// Ideally this would signal what inputs could be removed such that a matching
// flow could be found.
throw new Error("This server does not support registration with a phone number");
}
console.log("Active flow => %s", JSON.stringify(flow));
const nextStage = this._firstUncompletedStage(flow);
console.log("Next stage: %s", nextStage);