Code sync from Shipping Portal, independent deployment of Vue Polling, checkout from dillon/34-jenkins-vapor

This commit is contained in:
Dillon Ngo
2023-12-30 01:15:27 +08:00
parent 1ddf7923a5
commit 18df0e256b
37 changed files with 1281 additions and 23 deletions
@@ -17,6 +17,7 @@ use Illuminate\Http\Resources\Json\ResourceCollection;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Log;
use App\Classes\Exceptions\JobResourceNotFoundException;
abstract class AbstractControllerLogic
{
@@ -67,7 +68,19 @@ abstract class AbstractControllerLogic
return $response;
} catch (ErrorException|GeneralExceptions $exception){
log::error($exception);
if ($exception instanceof JobResourceNotFoundException) {
Log::error(sprintf(
"Uncaught exception '%s' with message '%s' in %s:%d",
get_class($exception),
$exception->getMessage(),
$exception->getTrace()[0]['file'],
$exception->getTrace()[0]['line']
));
}
else{
log::error($exception);
}
return (new ApiResponseObject($this->getNotificationTitle().' failed', $exception->getMessage(),
$exception->getCode() ? $exception->getCode() : HttpStatus::SERVER_ERROR))->handler();