Answer the question
In order to leave comments, you need to log in
How to return throw correctly in laravel?
How to return throw correctly in laravel?
The problem is if you return
catch (\Exception $exception){
return response('Сервер недоступен обратитесь к системному администратору' . $exception,500);
}
Answer the question
In order to leave comments, you need to log in
Answer found, maybe it will help someone
return response()->exception('Сервер недоступен обратитесь к системному администратору' . $exception,500);
return response()->json(['message' => 'Сервер недоступен обратитесь к системному администратору'], 500);
axios.get('/user/12345')
.catch(function (error) {
if (error.message) {
console.log('Error', error.message);
}
console.log(error);
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question