Fix lint & prettier issues
This commit is contained in:
parent
5a0eec1eb9
commit
163ee872bf
@ -1,7 +1,7 @@
|
|||||||
import { Server } from "hyper-express";
|
import { Server } from "hyper-express";
|
||||||
import Response from "hyper-express/types/components/http/Response";
|
import Response from "hyper-express/types/components/http/Response";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {isErrorApiData} from "../Messages/JsonMessages/ErrorApiData";
|
import { isErrorApiData } from "../Messages/JsonMessages/ErrorApiData";
|
||||||
|
|
||||||
export class BaseHttpController {
|
export class BaseHttpController {
|
||||||
constructor(protected app: Server) {
|
constructor(protected app: Server) {
|
||||||
|
@ -22,7 +22,6 @@ import {
|
|||||||
FollowAbortMessage,
|
FollowAbortMessage,
|
||||||
VariableMessage,
|
VariableMessage,
|
||||||
LockGroupPromptMessage,
|
LockGroupPromptMessage,
|
||||||
ErrorScreenMessage,
|
|
||||||
} from "../Messages/generated/messages_pb";
|
} from "../Messages/generated/messages_pb";
|
||||||
import { UserMovesMessage } from "../Messages/generated/messages_pb";
|
import { UserMovesMessage } from "../Messages/generated/messages_pb";
|
||||||
import { parse } from "query-string";
|
import { parse } from "query-string";
|
||||||
@ -41,7 +40,7 @@ import { localWokaService } from "../Services/LocalWokaService";
|
|||||||
import { WebSocket } from "uWebSockets.js";
|
import { WebSocket } from "uWebSockets.js";
|
||||||
import { WokaDetail } from "../Messages/JsonMessages/PlayerTextures";
|
import { WokaDetail } from "../Messages/JsonMessages/PlayerTextures";
|
||||||
import { z } from "zod";
|
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
|
* The object passed between the "open" and the "upgrade" methods when opening a websocket
|
||||||
@ -324,20 +323,20 @@ export class IoSocketController {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (Axios.isAxiosError(err)) {
|
if (Axios.isAxiosError(err)) {
|
||||||
const errorType = isErrorApiData.safeParse(err?.response?.data);
|
const errorType = isErrorApiData.safeParse(err?.response?.data);
|
||||||
if(errorType.success) {
|
if (errorType.success) {
|
||||||
return res.upgrade(
|
return res.upgrade(
|
||||||
{
|
{
|
||||||
rejected: true,
|
rejected: true,
|
||||||
reason: "error",
|
reason: "error",
|
||||||
status: err?.response?.status,
|
status: err?.response?.status,
|
||||||
error: errorType.data,
|
error: errorType.data,
|
||||||
} as UpgradeFailedData,
|
} as UpgradeFailedData,
|
||||||
websocketKey,
|
websocketKey,
|
||||||
websocketProtocol,
|
websocketProtocol,
|
||||||
websocketExtensions,
|
websocketExtensions,
|
||||||
context
|
context
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw err;
|
throw err;
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ import Debug from "debug";
|
|||||||
import { ExAdminSocketInterface } from "../Model/Websocket/ExAdminSocketInterface";
|
import { ExAdminSocketInterface } from "../Model/Websocket/ExAdminSocketInterface";
|
||||||
import { compressors } from "hyper-express";
|
import { compressors } from "hyper-express";
|
||||||
import { isMapDetailsData } from "../Messages/JsonMessages/MapDetailsData";
|
import { isMapDetailsData } from "../Messages/JsonMessages/MapDetailsData";
|
||||||
import {ErrorApiData} from "../Messages/JsonMessages/ErrorApiData";
|
import { ErrorApiData } from "../Messages/JsonMessages/ErrorApiData";
|
||||||
|
|
||||||
const debug = Debug("socket");
|
const debug = Debug("socket");
|
||||||
|
|
||||||
@ -654,10 +654,11 @@ export class SocketManager implements ZoneEventListener {
|
|||||||
errorMessage.setDetails(error.details);
|
errorMessage.setDetails(error.details);
|
||||||
errorMessage.setImage(error.image);
|
errorMessage.setImage(error.image);
|
||||||
|
|
||||||
if(error.urlToRedirect) errorMessage.setUrltoredirect(error.urlToRedirect);
|
if (error.urlToRedirect) errorMessage.setUrltoredirect(error.urlToRedirect);
|
||||||
if(error.buttonTitle) errorMessage.setButtontitle(error.buttonTitle);
|
if (error.buttonTitle) errorMessage.setButtontitle(error.buttonTitle);
|
||||||
if(!!error.canRetryManual) errorMessage.setCanretrymanual(error.canRetryManual);
|
if (!!error.canRetryManual) errorMessage.setCanretrymanual(error.canRetryManual);
|
||||||
if(error.timeToRetry && !isNaN(Number(error.timeToRetry))) errorMessage.setTimetoretry(Number(error.timeToRetry));
|
if (error.timeToRetry && !isNaN(Number(error.timeToRetry)))
|
||||||
|
errorMessage.setTimetoretry(Number(error.timeToRetry));
|
||||||
|
|
||||||
const serverToClientMessage = new ServerToClientMessage();
|
const serverToClientMessage = new ServerToClientMessage();
|
||||||
serverToClientMessage.setErrorscreenmessage(errorMessage);
|
serverToClientMessage.setErrorscreenmessage(errorMessage);
|
||||||
|
Loading…
Reference in New Issue
Block a user