示例#1
0
 /**
  * Respond with an error.
  *
  * @param  stirng $message
  * @param  stirng $errorCode
  * @return Illuminate\Http\Response
  */
 protected function respondWithError($message, $errorCode)
 {
     if ($this->statusCode == Response::HTTP_OK) {
         throw new UnexpectedValueException('Error response requested with 200 status code; user error.');
     }
     $out = $this->output->asError($message, $this->statusCode, $errorCode);
     return $this->respondWithArray($out);
 }
 /**
  * Respond with an error.
  *
  * @param  stirng $message
  * @param  stirng $errorCode
  * @return Illuminate\Http\Response
  */
 protected function respondWithError($message)
 {
     $out = $this->output->asError($message, $this->statusCode);
     return $this->respondWithArray($out);
 }