diff --git a/pusher/src/Controller/BaseHttpController.ts b/pusher/src/Controller/BaseHttpController.ts index 3f961c5d..b48e1457 100644 --- a/pusher/src/Controller/BaseHttpController.ts +++ b/pusher/src/Controller/BaseHttpController.ts @@ -1,7 +1,7 @@ import { Server } from "hyper-express"; import Response from "hyper-express/types/components/http/Response"; import axios from "axios"; -import {isErrorApiData} from "../Messages/JsonMessages/ErrorApiData"; +import { isErrorApiData } from "../Messages/JsonMessages/ErrorApiData"; export class BaseHttpController { constructor(protected app: Server) { diff --git a/pusher/src/Controller/IoSocketController.ts b/pusher/src/Controller/IoSocketController.ts index df21d301..f23db76c 100644 --- a/pusher/src/Controller/IoSocketController.ts +++ b/pusher/src/Controller/IoSocketController.ts @@ -22,7 +22,6 @@ import { FollowAbortMessage, VariableMessage, LockGroupPromptMessage, - ErrorScreenMessage, } from "../Messages/generated/messages_pb"; import { UserMovesMessage } from "../Messages/generated/messages_pb"; import { parse } from "query-string"; @@ -41,7 +40,7 @@ import { localWokaService } from "../Services/LocalWokaService"; import { WebSocket } from "uWebSockets.js"; import { WokaDetail } from "../Messages/JsonMessages/PlayerTextures"; import { z } from "zod"; -import {ErrorApiData, isErrorApiData} from "../Messages/JsonMessages/ErrorApiData"; +import { ErrorApiData, isErrorApiData } from "../Messages/JsonMessages/ErrorApiData"; /** * The object passed between the "open" and the "upgrade" methods when opening a websocket @@ -324,20 +323,20 @@ export class IoSocketController { } catch (err) { if (Axios.isAxiosError(err)) { const errorType = isErrorApiData.safeParse(err?.response?.data); - if(errorType.success) { - return res.upgrade( - { - rejected: true, - reason: "error", - status: err?.response?.status, - error: errorType.data, - } as UpgradeFailedData, - websocketKey, - websocketProtocol, - websocketExtensions, - context - ); - } + if (errorType.success) { + return res.upgrade( + { + rejected: true, + reason: "error", + status: err?.response?.status, + error: errorType.data, + } as UpgradeFailedData, + websocketKey, + websocketProtocol, + websocketExtensions, + context + ); + } } throw err; } diff --git a/pusher/src/Services/SocketManager.ts b/pusher/src/Services/SocketManager.ts index d535878d..685845a1 100644 --- a/pusher/src/Services/SocketManager.ts +++ b/pusher/src/Services/SocketManager.ts @@ -55,7 +55,7 @@ import Debug from "debug"; import { ExAdminSocketInterface } from "../Model/Websocket/ExAdminSocketInterface"; import { compressors } from "hyper-express"; import { isMapDetailsData } from "../Messages/JsonMessages/MapDetailsData"; -import {ErrorApiData} from "../Messages/JsonMessages/ErrorApiData"; +import { ErrorApiData } from "../Messages/JsonMessages/ErrorApiData"; const debug = Debug("socket"); @@ -654,10 +654,11 @@ export class SocketManager implements ZoneEventListener { errorMessage.setDetails(error.details); errorMessage.setImage(error.image); - if(error.urlToRedirect) errorMessage.setUrltoredirect(error.urlToRedirect); - if(error.buttonTitle) errorMessage.setButtontitle(error.buttonTitle); - if(!!error.canRetryManual) errorMessage.setCanretrymanual(error.canRetryManual); - if(error.timeToRetry && !isNaN(Number(error.timeToRetry))) errorMessage.setTimetoretry(Number(error.timeToRetry)); + if (error.urlToRedirect) errorMessage.setUrltoredirect(error.urlToRedirect); + if (error.buttonTitle) errorMessage.setButtontitle(error.buttonTitle); + if (!!error.canRetryManual) errorMessage.setCanretrymanual(error.canRetryManual); + if (error.timeToRetry && !isNaN(Number(error.timeToRetry))) + errorMessage.setTimetoretry(Number(error.timeToRetry)); const serverToClientMessage = new ServerToClientMessage(); serverToClientMessage.setErrorscreenmessage(errorMessage);