protected function errorResponse($json) { $error = new Error('Bad Request', json_decode($json)); return $this->createResponse(new BadRequest(new ErrorBag([$error]))); }