Пример #1
0
 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());
 }
Пример #2
0
 /**
  * @param DomainException $domainException
  */
 protected function processException(DomainException $domainException)
 {
     if ($this->getParameterResolver()->resolveApi()) {
         throw new HttpException($domainException->getStatusCode() ?: 500, $domainException->getMessage() ?: 'Internal Server Error', $domainException);
     }
 }
Пример #3
0
 /**
  * @param DomainException $domainException
  */
 private function processException(DomainException $domainException)
 {
     if ($this->getParameterResolver()->resolveApi()) {
         throw new HttpException($domainException->getStatusCode(), $domainException->getMessage(), $domainException);
     }
 }