芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/www/vendor/froiden/laravel-rest-api/src/Handlers/ApiExceptionHandler.php
is($prefix . '/*')) { // When the user is not authenticated or logged show this message with status code 401 if ($e instanceof AuthenticationException) { return ApiResponse::exception(new UnauthenticationException()); } if ($e instanceof HttpResponseException || $e instanceof \Illuminate\Validation\ValidationException) { if ($e->status == 403) { return ApiResponse::exception(new UnauthorizedException()); } return ApiResponse::exception(new ValidationException($e->errors())); } if ($e instanceof NotFoundHttpException) { return ApiResponse::exception(new ApiException('This api endpoint does not exist', null, 404, 404, 2005, [ 'url' => request()->url() ])); } if ($e instanceof ModelNotFoundException) { return ApiResponse::exception(new ApiException('Requested resource not found', null, 404, 404, null, [ 'url' => request()->url() ])); } if ($e instanceof ApiException) { return ApiResponse::exception($e); } if ($e instanceof QueryException) { if ($e->getCode() == "422") { preg_match("/Unknown column \\'([^']+)\\'/", $e->getMessage(), $result); if (!isset($result[1])) { return ApiResponse::exception(new UnknownFieldException(null, $e)); } $parts = explode(".", $result[1]); $field = count($parts) > 1 ? $parts[1] : $result; return ApiResponse::exception(new UnknownFieldException("Field '" . $field . "' does not exist", $e)); } } // When Debug is on move show error here $response['trace'] = $e->getTrace(); $response['code'] = $e->getCode(); return ApiResponse::exception(new ApiException(null, null, 500, 500, null, $response)); } return parent::render($request, $e); } }