diff --git a/app/Config/Autoload.php b/app/Config/Autoload.php index 525acb3c..be0e2476 100755 --- a/app/Config/Autoload.php +++ b/app/Config/Autoload.php @@ -101,6 +101,6 @@ class Autoload extends AutoloadConfig * @phpstan-var list */ public $helpers = ['uuid','session','utility', 'form', 'url', 'oauth', 'fileupload', - 'excel_import_export', 'file', 'drive','ExcelSanitizeHelper', 'api_helper','ExceptionHelper' + 'excel_import_export', 'file', 'drive','ExcelSanitizeHelper', 'api_helper','exception' ]; } diff --git a/app/Controllers/ThzController.php b/app/Controllers/ThzController.php index 0f8125b3..c1896be4 100644 --- a/app/Controllers/ThzController.php +++ b/app/Controllers/ThzController.php @@ -120,9 +120,8 @@ class ThzController extends BaseController if ($returnType === 'api') { if (empty($tickets)) { - // return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404); $this->myLogger->logme('error', 'empty tickets in ticket list: ' . json_encode($tickets)); - throw new \RuntimeException('No tickets found', 400); + return $this->response->setJSON([ 'status' => 'error','message' => 'No tickets found'])->setStatusCode(404); } } else { $data['ticket_data'] = $tickets; diff --git a/app/Helpers/ExceptionHelper.php b/app/Helpers/exception_helper.php similarity index 100% rename from app/Helpers/ExceptionHelper.php rename to app/Helpers/exception_helper.php