CHANGE_ERROR_DATA
This commit is contained in:
parent
1801a85047
commit
f041cd3a29
@ -1457,7 +1457,19 @@ class EmployeeRestController extends AdminController
|
|||||||
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 200);
|
return $this->respond(['status' => 'failed','code' => 404,'data' => []], 200);
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getLine()], 500);
|
|
||||||
|
$errorData = [
|
||||||
|
'message' => $e->getMessage(),
|
||||||
|
'file' => $e->getFile(),
|
||||||
|
'line' => $e->getLine(),
|
||||||
|
'code' => $e->getCode(),
|
||||||
|
'trace' => $e->getTraceAsString(),
|
||||||
|
'trace_array' => $e->getTrace(), // full array version (optional)
|
||||||
|
'function' => $e->getTrace()[0]['function'] ?? null,
|
||||||
|
'class' => $e->getTrace()[0]['class'] ?? null,
|
||||||
|
];
|
||||||
|
|
||||||
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $e->getLine(), 'error_data' => $errorData], 500);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user