-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwebsocket.exceptions.php
More file actions
33 lines (28 loc) · 942 Bytes
/
Copy pathwebsocket.exceptions.php
File metadata and controls
33 lines (28 loc) · 942 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
class WebSocketMessageNotFinalised extends Exception{
public function __construct(IWebSocketMessage $msg){
parent::__construct("WebSocketMessage is not finalised!");
}
}
class WebSocketFrameSizeMismatch extends Exception{
public function __construct(IWebSocketFrame $msg){
parent::__construct("Frame size mismatches with the expected frame size. Maybe a buggy client.");
}
}
class WebSocketInvalidChallengeResponse extends Exception{
public function __construct(){
parent::__construct("Server send an incorrect response to the clients challenge!");
}
}
class WebSocketInvalidUrlScheme extends Exception{
public function __construct(){
parent::__construct("Only 'ws://' urls are supported!");
}
}
class WebSocketNotAuthorizedException extends Exception{
protected $user;
public function __construct(IWebSocketUser $user){
parent::__construct("None or invalid credentials provided!");
$this->user = $user;
}
}