E
E
Evgeny Musonov2020-06-22 09:46:05
React
Evgeny Musonov, 2020-06-22 09:46:05

How to handle errors coming from PHP server in React?

I set http_response_code () on the server side, for example 404 and at the same time I do

return json_encode([
            'status' => false,
            'message' => $message
        ], JSON_UNESCAPED_UNICODE);

But at the front comes out such a thing
Image
5ef053e0324a7020350486.jpeg

How to get a json object on the front in case of an error?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question