From cfa3f7329ff7b61698547220f688b03bc3eb209d Mon Sep 17 00:00:00 2001 From: amazuecos Date: Sun, 6 Apr 2025 06:00:52 +0200 Subject: [PATCH] add error resposne to get_orden_trabajo_summary --- ci4/app/Controllers/Produccion/Ordentrabajo.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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() {}