Stopping sending literal errors
Errors now must be of "Error" type. Rule added in eslint.
This commit is contained in:
parent
88509916a8
commit
ab0f5e9837
19 changed files with 31 additions and 28 deletions
|
@ -106,10 +106,10 @@ class ConnectionManager {
|
|||
const code = urlParams.get("code");
|
||||
const state = urlParams.get("state");
|
||||
if (!state || !localUserStore.verifyState(state)) {
|
||||
throw "Could not validate state!";
|
||||
throw new Error("Could not validate state!");
|
||||
}
|
||||
if (!code) {
|
||||
throw "No Auth code provided";
|
||||
throw new Error("No Auth code provided");
|
||||
}
|
||||
localUserStore.setCode(code);
|
||||
}
|
||||
|
@ -333,10 +333,10 @@ class ConnectionManager {
|
|||
|
||||
if (!token) {
|
||||
if (!state || !localUserStore.verifyState(state)) {
|
||||
throw "Could not validate state!";
|
||||
throw new Error("Could not validate state!");
|
||||
}
|
||||
if (!code) {
|
||||
throw "No Auth code provided";
|
||||
throw new Error("No Auth code provided");
|
||||
}
|
||||
}
|
||||
const { authToken, userUuid, textures, email } = await Axios.get(`${PUSHER_URL}/login-callback`, {
|
||||
|
|
|
@ -691,7 +691,7 @@ export class RoomConnection implements RoomConnection {
|
|||
}
|
||||
|
||||
public getUserId(): number {
|
||||
if (this.userId === null) throw "UserId cannot be null!";
|
||||
if (this.userId === null) throw new Error("UserId cannot be null!");
|
||||
return this.userId;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue