mirror of
https://github.com/vector-im/element-web.git
synced 2025-08-28 01:41:36 +02:00
Merge pull request #4646 from matrix-org/bwindels/detectnetworkfailureforjoin
Use connection error to detect network problem
This commit is contained in:
commit
3fc060c754
@ -273,9 +273,7 @@ class RoomViewStore extends Store {
|
|||||||
});
|
});
|
||||||
let msg = err.message ? err.message : JSON.stringify(err);
|
let msg = err.message ? err.message : JSON.stringify(err);
|
||||||
console.log("Failed to join room:", msg);
|
console.log("Failed to join room:", msg);
|
||||||
// XXX: We are relying on the error message returned by browsers here.
|
if (err.name === "ConnectionError") {
|
||||||
// This isn't great, but it does generalize the error being shown to users.
|
|
||||||
if (msg && msg.startsWith("CORS request rejected")) {
|
|
||||||
msg = _t("There was an error joining the room");
|
msg = _t("There was an error joining the room");
|
||||||
}
|
}
|
||||||
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
|
if (err.errcode === 'M_INCOMPATIBLE_ROOM_VERSION') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user