public static function createFromError($message, $code = 0)
    {
        if (!is_numeric($code)) {
            $message = trim("{$code} {$message}");
            $code = -1;
        }

        return new self($message, $code);
    }
public static function createFromError($message, $code = 0)
    {
        if (!is_numeric($code)) {
            $message = trim("{$code} {$message}");
            $code = -1;
        }

        return new self($message, $code);
    }
public static function createFromError ( $ message , $ code = 0 ) { if ( ! is_numeric ( $ code ) ) { $ message = trim ( "{$code} {$message}" ) ; $ code = - 1 ; } return new self ( $ message , $ code ) ; }
Create Exception using error code

@param string $message
@param int $code

@return self
Create Exception using error code