MCPcopy Index your code
hub / github.com/MCSManager/MCSManager / error

Function error

daemon/src/service/protocol.ts:78–93  ·  view source on GitHub ↗
(ctx: RouterContext, event: string, err: any, config?: IResponseErrorConfig)

Source from the content-addressed store, hash-verified

76}
77
78export function error(ctx: RouterContext, event: string, err: any, config?: IResponseErrorConfig) {
79 const packet = new Packet(ctx.uuid, STATUS_ERR, event, err);
80 // Ignore
81 if (String(err).includes(IGNORE) && ctx.event) return ctx.socket.emit(ctx.event, packet);
82 if (!config?.disablePrint)
83 logger.warn(
84 $t("TXT_CODE_protocol.socketErr", {
85 id: ctx.socket.id,
86 address: ctx.socket.handshake.address,
87 event: ctx.event
88 }),
89 err
90 );
91
92 ctx.socket.emit(event, packet);
93}
94
95export function parse(text: IPacket) {
96 if (typeof text == "object") {

Callers

nothing calls this directly

Calls 2

$tFunction · 0.90
emitMethod · 0.80

Tested by

no test coverage detected