PHP 8.2.31
Preview: RejectionException.php Size: 1.21 KB
/opt/cpanel/ea-wappspector/vendor/guzzlehttp/promises/src/RejectionException.php

<?php

declare(strict_types=1);

namespace GuzzleHttp\Promise;

/**
 * A special exception that is thrown when waiting on a rejected promise.
 *
 * The reason value is available via the getReason() method.
 */
class RejectionException extends \RuntimeException
{
    /** @var mixed Rejection reason. */
    private $reason;

    /**
     * @param mixed       $reason      Rejection reason.
     * @param string|null $description Optional description.
     */
    public function __construct($reason, ?string $description = null)
    {
        $this->reason = $reason;

        $message = 'The promise was rejected';

        if ($description) {
            $message .= ' with reason: '.$description;
        } elseif (is_string($reason)
            || (is_object($reason) && method_exists($reason, '__toString'))
        ) {
            $message .= ' with reason: '.$this->reason;
        } elseif ($reason instanceof \JsonSerializable) {
            $message .= ' with reason: '.json_encode($this->reason, JSON_PRETTY_PRINT);
        }

        parent::__construct($message);
    }

    /**
     * Returns the rejection reason.
     *
     * @return mixed
     */
    public function getReason()
    {
        return $this->reason;
    }
}

Directory Contents

Dirs: 0 × Files: 16

Name Size Perms Modified Actions
413 B lrw-r--r-- 2025-08-22 14:34:08
Edit Download
209 B lrw-r--r-- 2025-08-22 14:34:08
Edit Download
4.07 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
1.96 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
2.60 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
7.42 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
2.00 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
941 B lrw-r--r-- 2025-08-22 14:34:08
Edit Download
8.75 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
2.76 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
249 B lrw-r--r-- 2025-08-22 14:34:08
Edit Download
2.21 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
1.21 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
1.97 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download
450 B lrw-r--r-- 2025-08-22 14:34:08
Edit Download
8.25 KB lrw-r--r-- 2025-08-22 14:34:08
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).