| 1 | <?php |
||
| 7 | class JsonError |
||
| 8 | { |
||
| 9 | private $error; |
||
| 10 | |||
| 11 | private $exceptions = array( |
||
| 12 | JSON_ERROR_DEPTH => 'JsonDepthException', |
||
| 13 | JSON_ERROR_STATE_MISMATCH => 'JsonStateMismatchException', |
||
| 14 | JSON_ERROR_CTRL_CHAR => 'JsonControlCharacterExeption', |
||
| 15 | JSON_ERROR_SYNTAX => 'JsonSyntaxException', |
||
| 16 | JSON_ERROR_UTF8 => 'JsonUtf8Exception', |
||
| 17 | JSON_ERROR_RECURSION => 'JsonRecursionException', |
||
| 18 | JSON_ERROR_INF_OR_NAN => 'JsonInfOrNanException', |
||
| 19 | JSON_ERROR_UNSUPPORTED_TYPE => 'JsonUnsupportedTypeException' |
||
| 20 | ); |
||
| 21 | |||
| 22 | /** |
||
| 23 | * hasError |
||
| 24 | * |
||
| 25 | * @access public |
||
| 26 | * @return boolean |
||
| 27 | */ |
||
| 28 | public function hasError() |
||
| 32 | |||
| 33 | /** |
||
| 34 | * Gets last json error. |
||
| 35 | * |
||
| 36 | * @return int |
||
| 37 | */ |
||
| 38 | public function getError() |
||
| 42 | |||
| 43 | public function throwException() |
||
| 51 | } |
||
| 52 |