mirror of
https://github.com/cheveguerra/whaticket-community.git
synced 2026-04-18 19:59:20 +00:00
use appError on socket io
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import socketIo, { Server as SocketIO } from "socket.io";
|
||||
import { Server } from "http";
|
||||
import AppError from "../errors/AppError";
|
||||
|
||||
let io: SocketIO;
|
||||
|
||||
@@ -9,7 +10,7 @@ export const initIO = (httpServer: Server): SocketIO => {
|
||||
};
|
||||
export const getIO = (): SocketIO => {
|
||||
if (!io) {
|
||||
throw new Error("Socket IO not initialized");
|
||||
throw new AppError("Socket IO not initialized");
|
||||
}
|
||||
return io;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user