# wp-stateless/2.1.4/lib/Google/vendor/react/promise/src/UnhandledRejectionException.php

WP-Stateless – Google Cloud Storage, version 2.1.4. 32 lines.

- Page: https://pluginprobe.com/plugins/wp-stateless/2.1.4/code/lib/Google/vendor/react/promise/src/UnhandledRejectionException.php
- Raw: https://pluginprobe.com/plugins/wp-stateless/2.1.4/raw/lib/Google/vendor/react/promise/src/UnhandledRejectionException.php
- Modified: 2018-04-06T08:15:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wp-stateless/2.1.4/code/lib/Google/vendor/react/promise/src/UnhandledRejectionException.php#L10-L20`.

```php
<?php

namespace React\Promise;

class UnhandledRejectionException extends \RuntimeException
{
    private $reason;

    public static function resolve($reason)
    {
        if ($reason instanceof \Exception || $reason instanceof \Throwable) {
            return $reason;
        }

        return new static($reason);
    }

    public function __construct($reason)
    {
        $this->reason = $reason;

        $message = sprintf('Unhandled Rejection: %s', json_encode($reason));

        parent::__construct($message, 0);
    }

    public function getReason()
    {
        return $this->reason;
    }
}

```
