public static function from(DriverInterface $driver, $message = '', $code = 0, \Exception $previous = null)
    {
        //make sure that empty arguments don't get passed to exceptions as
        //they have default messages and codes.
        $self = $message ? ($code ? new static($message, $code, $previous) : new static($message)) : new static();

        $self->setDriver($driver);

        return $self;
    }