12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace OCP;
- class HintException extends \Exception {
- private $hint;
-
- public function __construct($message, $hint = '', $code = 0, \Exception $previous = null) {
- $this->hint = $hint;
- parent::__construct($message, $code, $previous);
- }
-
- public function __toString(): string {
- return __CLASS__ . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
- }
-
- public function getHint(): string {
- if (empty($this->hint)) {
- return $this->message;
- }
- return $this->hint;
- }
- }
|