1
0
mirror of https://github.com/matrix-org/matrix-react-sdk.git synced 2026-01-03 21:42:32 +03:00

Merge pull request #92 from matrix-org/invalid_user_name

Catch new invalid user name error
This commit is contained in:
David Baker
2016-01-15 14:33:45 +00:00

View File

@@ -152,6 +152,8 @@ class Register extends Signup {
} else {
if (error.errcode === 'M_USER_IN_USE') {
throw new Error("Username in use");
} else if (error.errcode == 'M_INVALID_USERNAME') {
throw new Error("User names may only contain alphanumeric characters, underscores or dots!");
} else if (error.httpStatus == 401) {
throw new Error("Authorisation failed!");
} else if (error.httpStatus >= 400 && error.httpStatus < 500) {