UNPKG

@colyseus/core

Version:

Multiplayer Framework for Node.js.

92 lines (91 loc) 2.39 kB
// packages/core/src/errors/RoomExceptions.ts var OnCreateException = class extends Error { constructor(cause, message, options) { super(message, { cause }); this.name = "OnCreateException"; this.options = options; } }; var OnAuthException = class extends Error { constructor(cause, message, client, options) { super(message, { cause }); this.name = "OnAuthException"; this.client = client; this.options = options; } }; var OnJoinException = class extends Error { constructor(cause, message, client, options, auth) { super(message, { cause }); this.name = "OnJoinException"; this.client = client; this.options = options; this.auth = auth; } }; var OnLeaveException = class extends Error { constructor(cause, message, client, consented) { super(message, { cause }); this.name = "OnLeaveException"; this.client = client; this.consented = consented; } }; var OnDropException = class extends Error { constructor(cause, message, client, code) { super(message, { cause }); this.name = "OnDropException"; this.client = client; this.code = code; } }; var OnReconnectException = class extends Error { constructor(cause, message, client) { super(message, { cause }); this.name = "OnReconnectException"; this.client = client; } }; var OnDisposeException = class extends Error { constructor(cause, message) { super(message, { cause }); this.name = "OnDisposeException"; } }; var OnMessageException = class extends Error { constructor(cause, message, client, payload, type) { super(message, { cause }); this.name = "OnMessageException"; this.client = client; this.payload = payload; this.type = type; } isType(type) { return this.type === type; } }; var SimulationIntervalException = class extends Error { constructor(cause, message) { super(message, { cause }); this.name = "SimulationIntervalException"; } }; var TimedEventException = class extends Error { constructor(cause, message, ...args) { super(message, { cause }); this.name = "TimedEventException"; this.args = args; } }; export { OnAuthException, OnCreateException, OnDisposeException, OnDropException, OnJoinException, OnLeaveException, OnMessageException, OnReconnectException, SimulationIntervalException, TimedEventException };