38 lines
1010 B
PHP
38 lines
1010 B
PHP
<?php
|
|
|
|
class WorkflowException extends Exception {
|
|
protected $httpCode;
|
|
protected $details;
|
|
|
|
public function __construct($message = "", $httpCode = 500, $details = [], Throwable $previous = null) {
|
|
parent::__construct($message, 0, $previous);
|
|
$this->httpCode = $httpCode;
|
|
$this->details = $details;
|
|
}
|
|
|
|
public function getHttpCode() {
|
|
return $this->httpCode;
|
|
}
|
|
|
|
public function getDetails() {
|
|
return $this->details;
|
|
}
|
|
}
|
|
|
|
class WorkflowNotFoundException extends Exception {}
|
|
class WorkflowNotAllowedException extends Exception {}
|
|
class WorkflowRuleFailedException extends Exception {}
|
|
|
|
class WorkflowEligibilityException extends Exception {
|
|
private $reasons;
|
|
|
|
public function __construct($message = "", $reasons = [], $code = 0, Throwable $previous = null) {
|
|
parent::__construct($message, $code, $previous);
|
|
$this->reasons = $reasons;
|
|
}
|
|
|
|
public function getReasons() {
|
|
return $this->reasons;
|
|
}
|
|
}
|