public function transform(RestfulException $resource)
 {
     return ['status' => $resource->getStatus(), 'code' => $resource->getCode(), 'message' => $resource->getMessage(), 'description' => $resource->getDescription(), 'property' => $resource->getProperty()];
 }
Esempio n. 2
0
 /**
  * Respond with a RestfulException.
  *
  * @param RestfulException $exception
  */
 public function respondWithError(RestfulException $exception)
 {
     $item = new Item($exception, new RestfulExceptionTransformer());
     $this->respond($item, self::RESOURCE_TYPE_ERROR, $exception->getStatus());
 }