public function testInitialState() { $this->domainException = new DomainException($statusCode = Response::HTTP_BAD_REQUEST, $message = 'message', $code = 123, $previous = new \Exception()); $this->assertSame($statusCode, $this->domainException->getStatusCode()); $this->assertSame($message, $this->domainException->getMessage()); $this->assertSame($code, $this->domainException->getCode()); $this->assertSame($previous, $this->domainException->getPrevious()); }
/** * @param DomainException $domainException */ protected function processException(DomainException $domainException) { if ($this->getParameterResolver()->resolveApi()) { throw new HttpException($domainException->getStatusCode() ?: 500, $domainException->getMessage() ?: 'Internal Server Error', $domainException); } }
/** * @param DomainException $domainException */ private function processException(DomainException $domainException) { if ($this->getParameterResolver()->resolveApi()) { throw new HttpException($domainException->getStatusCode(), $domainException->getMessage(), $domainException); } }