The SSH error functions.

Overview

Functions for error handling. Moreā€¦

// global functions

const char*
ssh_get_error(void* error);

int
ssh_get_error_code(void* error);

void
_ssh_set_error(
    void* error,
    int code,
    const char* function,
    const char* descr,
    ...
);

void
_ssh_set_error_invalid(
    void* error,
    const char* function
);

void
_ssh_set_error_oom(
    void* error,
    const char* function
);

Detailed Documentation

Functions for error handling.

Global Functions

const char*
ssh_get_error(void* error)

Retrieve the error text message from the last error.

Parameters:

error

An ssh_session or ssh_bind.

Returns:

A static string describing the error.

int
ssh_get_error_code(void* error)

Retrieve the error code from the last error.

Parameters:

error

An ssh_session or ssh_bind.

Returns:

SSH_NO_ERROR No error occurred

SSH_REQUEST_DENIED The last request was denied but situation is recoverable

SSH_FATAL A fatal error occurred. This could be an unexpected disconnection

Other error codes are internal but can be considered same than SSH_FATAL.