PluginProbe
DecaLog / 3.0.2
DecaLog v3.0.2
3.0.2 3.1.0 3.10.0 3.2.0 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 3.7.1 3.8.0 3.9.0 3.9.1 4.0.0 4.1.0 4.2.0 4.3.0 4.3.1 4.4.0 4.5.0 All 75 releases
decalog / includes / libraries / react / Promise / UnhandledRejectionException.php

UnhandledRejectionException.php in DecaLog 3.0.2, at includes/libraries/react/Promise/UnhandledRejectionException.php

32 lines 613 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace React\Promise;
4
5 class UnhandledRejectionException extends \RuntimeException
6 {
7 private $reason;
8
9 public static function resolve($reason)
10 {
11 if ($reason instanceof \Exception || $reason instanceof \Throwable) {
12 return $reason;
13 }
14
15 return new static($reason);
16 }
17
18 public function __construct($reason)
19 {
20 $this->reason = $reason;
21
22 $message = \sprintf('Unhandled Rejection: %s', \json_encode($reason));
23
24 parent::__construct($message, 0);
25 }
26
27 public function getReason()
28 {
29 return $this->reason;
30 }
31 }
32