123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?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 self::class . ": [{$this->code}]: {$this->message} ({$this->hint})\n";
- }
-
- public function getHint(): string {
- if (empty($this->hint)) {
- return $this->message;
- }
- return $this->hint;
- }
- }
|