Flugg\Responder\Exceptions\Http\ApiException::getErrorCode PHP Method

getErrorCode() public method

Get the error code.
public getErrorCode ( ) : string
return string
    public function getErrorCode()
    {
        return $this->errorCode;
    }

Usage Example

コード例 #1
0
 /**
  * Renders any API exception into a JSON error response.
  *
  * @param  ApiException $exception
  * @return JsonResponse
  */
 protected function renderApiError(ApiException $exception) : JsonResponse
 {
     return app('responder.error')->setError($exception->getErrorCode(), $exception->getMessage())->addData($exception->getData() ?: [])->respond($exception->getStatusCode());
 }