public static function fromThrowable($throwable)
    {
        if ($throwable instanceof \Error) {
            $throwable = ErrorException::fromError($throwable);
        }

        if (!$throwable instanceof \Exception) {
            throw new \InvalidArgumentException('throw-up can only throw Exceptions and Errors');
        }

        return new self($throwable);
    }
public static function fromThrowable($throwable)
    {
        if ($throwable instanceof \Error) {
            $throwable = ErrorException::fromError($throwable);
        }

        if (!$throwable instanceof \Exception) {
            throw new \InvalidArgumentException('throw-up can only throw Exceptions and Errors');
        }

        return new self($throwable);
    }
public static function fromThrowable ( $ throwable ) { if ( $ throwable instanceof \ Error ) { $ throwable = ErrorException :: fromError ( $ throwable ) ; } if ( ! $ throwable instanceof \ Exception ) { throw new \ InvalidArgumentException ( 'throw-up can only throw Exceptions and Errors' ) ; } return new self ( $ throwable ) ; }
Create a ThrowUpException from a Throwable.

@param \Throwable $throwable

@return ThrowUpException
Create a ThrowUpException from a Throwable .