In Laravel
I have the following controller and method:
public function uploadattachment(Request $request)
{
try {
$aa = 3/0;
}
catch (Throwable $t) {
return response()->json([
'status' => 'Error',
'message' => $t->getMessage()
]);
}
}
When I call above method from Angular I get error 500 internal server error
. I thought that I will receive 200
and exception will be handled in catch
clause in message property
Throwable is under Exception. If dividing by zero is handled by Exception it should be by Throwable as well: division by zero