diff --git a/ci4/app/Controllers/Produccion/Ordentrabajo.php b/ci4/app/Controllers/Produccion/Ordentrabajo.php index 1b802ecb..3238788b 100755 --- a/ci4/app/Controllers/Produccion/Ordentrabajo.php +++ b/ci4/app/Controllers/Produccion/Ordentrabajo.php @@ -68,8 +68,13 @@ class Ordentrabajo extends BaseController public function get_orden_trabajo_summary($orden_trabajo_id) { - $summary = $this->produccionService->init($orden_trabajo_id)->getSummary(); - return $this->response->setJSON($summary); + try { + //code... + $summary = $this->produccionService->init($orden_trabajo_id)->getSummary(); + return $this->response->setJSON($summary); + } catch (\Throwable $th) { + return $this->response->setStatusCode(500)->setJSON(["message" => $th->getMessage(), "error" => $th]); + } } public function add() {}