/**
  * Construction of the exception - a message is needed (1st argument)
  *
  * @param string $message The exception message
  * @param int $code The exception code
  * @param \Exception $previous The previous exception if so
  */
 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     if (empty($message)) {
         $message = 'Not found';
     }
     parent::__construct($message, $code, $previous);
     $this->webservices->setStatus(FrontController::STATUS_REQUEST_ERROR)->setMessage($this->getMessage())->getResponse()->setStatus(HttpStatus::NOT_FOUND);
 }
 /**
  * Construction of the exception - a message is needed (1st argument)
  *
  * @param string $message The exception message
  * @param int $code The exception code
  * @param \Exception $previous The previous exception if so
  */
 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     if (empty($message)) {
         $message = 'Treatment error';
     }
     parent::__construct($message, $code, $previous);
     $this->webservices->setStatus(FrontController::STATUS_TREATMENT_ERROR)->setMessage($this->getMessage())->getResponse()->setStatus(HttpStatus::UNPROCESSABLE_ENTITY);
 }
Ejemplo n.º 3
0
 /**
  * @param string $message
  * @param int $code
  * @param \Exception $previous
  */
 public function __construct($message = '', $code = 0, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
     $this->setFrontController(FrontController::getInstance());
     $this->webservices->setStatus(FrontController::STATUS_TREATMENT_ERROR)->getResponse()->setStatus(HttpStatus::ERROR);
 }