Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $response = '{"errorId":0';
- try {
- json_decode($response);
- if (json_last_error() !== JSON_ERROR_NONE) {
- throw new \Exception('Информация для устранения ошибки');
- }
- } catch (\Exception $e) {
- // log exception
- // По моему мнению, большинство клиентов при HTTP коде != 200, сделают повторный запрос
- header('HTTP/1.1 500 Internal Server Error');
- exit();
- }
- echo $response;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement