24 lines
647 B
PHP
24 lines
647 B
PHP
<?php
|
|
namespace common\components;
|
|
|
|
class FitnessException extends \Exception {
|
|
const TYPE_BAD_REQUEST = "BAD_REQUEST";
|
|
const UNKNOWN_ERROR = "UNKNOWN_ERROR";
|
|
public $errorCode;
|
|
public $type;
|
|
public $payload;
|
|
public $originalException;
|
|
|
|
public function __construct( $message, $type = FitnessException::TYPE_BAD_REQUEST, $errorCode = null, $payload = null, $originalException= null) {
|
|
parent::__construct();
|
|
$this->message = $message;
|
|
$this->type = $type;
|
|
$this->errorCode = $errorCode;
|
|
$this->payload = $payload;
|
|
$this->originalException = $originalException;
|
|
}
|
|
|
|
|
|
|
|
}
|