add error resposne to get_orden_trabajo_summary

This commit is contained in:
amazuecos
2025-04-06 06:00:52 +02:00
parent f362087c01
commit cfa3f7329f

View File

@ -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() {}