libssh 0.12.0
The SSH library
Loading...
Searching...
No Matches
ssh::SshException Class Reference

if defined, disable C++ exceptions for libssh c++ wrapper More...

#include <libsshpp.hpp>

Public Member Functions

 SshException (ssh_session csession)
 Construct an exception from a libssh session error state. Captures the current error code and error string associated with the given session.
 SshException (const SshException &e)
 Copy-construct an exception.
int getCode ()
 returns the Error code
std::string getError ()
 returns the error message of the last exception

Detailed Description

if defined, disable C++ exceptions for libssh c++ wrapper

Some people do not like C++ exceptions. With this define, we give the choice to use or not exceptions.

This class describes a SSH Exception object. This object can be thrown by several SSH functions that interact with the network, and may fail because of socket, protocol or memory errors.

Constructor & Destructor Documentation

◆ SshException() [1/2]

ssh::SshException::SshException ( ssh_session csession)
inline

Construct an exception from a libssh session error state. Captures the current error code and error string associated with the given session.

Parameters
[in]csessionlibssh session handle used to query error details.
See also
ssh_get_error_code
ssh_get_error

◆ SshException() [2/2]

ssh::SshException::SshException ( const SshException & e)
inline

Copy-construct an exception.

Parameters
[in]eSource exception.

Member Function Documentation

◆ getCode()

int ssh::SshException::getCode ( )
inline

returns the Error code

Returns
SSH_FATAL Fatal error happened (not recoverable)
SSH_REQUEST_DENIED Request was denied by remote host
See also
ssh_get_error_code

◆ getError()

std::string ssh::SshException::getError ( )
inline

returns the error message of the last exception

Returns
pointer to a c string containing the description of error
See also
ssh_get_error

The documentation for this class was generated from the following file:
  • /home/asn/workspace/prj/oss/libssh/asn-docs/include/libssh/libsshpp.hpp