mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-24 00:23:12 +09:00
Host shutdown on duplicate connection (#647)
* Update no-shadow lint rule for enums https://typescript-eslint.io/rules/no-shadow/ * Add websocket close codes enum * Pass close code and reason to event handlers * Shutdown host on duplicate connection * Add connection refusal * Fix lib/link tests * Response to comments * Additional Tests * Removed missed codes in close event
This commit is contained in:
1 parent
c0e631e251
commit
dfc406d025
10 files changed
+210
-35
No files matched your search
@@ -61,13 +61,34 @@ export class SessionLost extends Error {
|
||||
code = "SessionLost";
|
||||
}
|
||||
|
||||
/**
|
||||
* Super class for all custom websocket errors
|
||||
*/
|
||||
export class WebSocketError extends Error {
|
||||
code = "WebSocketError";
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when WebSocket authentication failed
|
||||
*/
|
||||
export class AuthenticationFailed extends Error {
|
||||
export class AuthenticationFailed extends WebSocketError {
|
||||
code = "AuthenticationFailed";
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when WebSocket protocol is violated
|
||||
*/
|
||||
export class ProtocolError extends WebSocketError {
|
||||
code = "ProtocolError";
|
||||
}
|
||||
|
||||
/**
|
||||
* Thrown when WebSocket policy is violated
|
||||
*/
|
||||
export class PolicyViolation extends WebSocketError {
|
||||
code = "PolicyViolation";
|
||||
}
|
||||
|
||||
/**
|
||||
* Errror class for known errors occuring during startup
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user