diff --git a/app/Controllers/EmployeeController.php b/app/Controllers/EmployeeController.php index 66549050..d40ee267 100755 --- a/app/Controllers/EmployeeController.php +++ b/app/Controllers/EmployeeController.php @@ -1076,10 +1076,23 @@ class EmployeeController extends AdminController } return $this->respond(['dataStatus' => true, 'code' => 200, 'data' => $html, 'file_data' => $file_name, 'excel_data' => $excel_data], 200); - } catch (\Exception $e) { + } catch (\Throwable $th) { + + $errorData = [ + 'message' => $th->getMessage(), + 'file' => $th->getFile(), + 'line' => $th->getLine(), + 'code' => $th->getCode(), + 'trace' => $th->getTraceAsString(), + 'trace_array' => $th->getTrace(), // full array version (optional) + 'function' => $th->getTrace()[0]['function'] ?? null, + 'class' => $th->getTrace()[0]['class'] ?? null, + ]; + // Handle exception - $errorMessage = 'Error occurred: ' . $e->getMessage(); + $errorMessage = 'Error occurred:' . PHP_EOL . json_encode($errorData, JSON_PRETTY_PRINT); $this->myLogger->logme('error', $errorMessage); + $html = '
No Data Found
'; return $this->respond(['dataStatus' => false, 'code' => 500, 'data' => $html, 'file_data' => $file_name], 500); } diff --git a/app/Views/view_file_upload_emp_list.php b/app/Views/view_file_upload_emp_list.php index 96ce9b36..aab97b08 100755 --- a/app/Views/view_file_upload_emp_list.php +++ b/app/Views/view_file_upload_emp_list.php @@ -22,15 +22,13 @@ table.dataTable tbody td { - - - - - - - - - + + + + + + +