<?php namespace Ratchet\Wamp; class JsonException extends Exception { public function __construct() { $code = json_last_error(); switch ($code) { case JSON_ERROR_DEPTH: $msg = 'Maximum stack depth exceeded'; break; case JSON_ERROR_STATE_MISMATCH: $msg = 'Underflow or the modes mismatch'; break; case JSON_ERROR_CTRL_CHAR: $msg = 'Unexpected control character found'; break; case JSON_ERROR_SYNTAX: $msg = 'Syntax error, malformed JSON'; break; case JSON_ERROR_UTF8: $msg = 'Malformed UTF-8 characters, possibly incorrectly encoded'; break; default: $msg = 'Unknown error'; break; } parent::__construct($msg, $code); } }
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
Exception.php | File | 70 B | 0644 |
|
JsonException.php | File | 904 B | 0644 |
|
ServerProtocol.php | File | 4.65 KB | 0644 |
|
Topic.php | File | 2.32 KB | 0644 |
|
TopicManager.php | File | 3.02 KB | 0644 |
|
WampConnection.php | File | 3.42 KB | 0644 |
|
WampServer.php | File | 1.81 KB | 0644 |
|
WampServerInterface.php | File | 1.92 KB | 0644 |
|