*/ class ModelNotFoundTransformer implements TransformerInterface { /** * Transform the provided exception. * * @param \Exception $exception * * @return \Exception */ public function transform(Exception $exception) { if ($exception instanceof ModelNotFoundException) { $exception = new HttpNotFoundException('Resource not found'); } return $exception; } }