*/ class BusTransformer implements TransformerInterface { /** * Transform the provided exception. * * @param \Exception $exception * * @return \Exception */ public function transform(Exception $exception) { if ($exception instanceof ExceptionInterface) { $exception = new BadRequestHttpException($exception->getMessage()); } return $exception; } }