aboutsummaryrefslogtreecommitdiff
path: root/doc/tbd.dox
diff options
context:
space:
mode:
Diffstat (limited to 'doc/tbd.dox')
-rw-r--r--doc/tbd.dox27
1 files changed, 25 insertions, 2 deletions
diff --git a/doc/tbd.dox b/doc/tbd.dox
index ed4e8825..4ee5ab84 100644
--- a/doc/tbd.dox
+++ b/doc/tbd.dox
@@ -1,8 +1,31 @@
/**
@page tbd To be done
-@section scp_subsystem The SCP subsystem
+@section errors Handling the errors
+
+When some function returns an error code, it's always possible to get an
+english message describing the problem.
+
+The function ssh_get_error() returns a pointer to the static error buffer.
+
+ssh_error_code() returns the error code number : SSH_NO_ERROR,
+SSH_REQUEST_DENIED, SSH_INVALID_REQUEST, SSH_CONNECTION_LOST, SSH_FATAL,
+or SSH_INVALID_DATA. SSH_REQUEST_DENIED means the ssh server refused your
+request, but the situation is recoverable. The others mean something happened
+to the connection (some encryption problems, server problems, ...).
+SSH_INVALID_REQUEST means the library got some garbage from server, but
+might be recoverable. SSH_FATAL means the connection has an important
+problem and isn't probably recoverable.
+
+Most of time, the error returned are SSH_FATAL, but some functions
+(generaly the ssh_request_xxx ones) may fail because of server denying request.
+In these cases, SSH_REQUEST_DENIED is returned.
+
+ssh_get_error() and ssh_get_error_code() take a ssh_session as a parameter.
+That's for thread safety, error messages that can be attached to a session
+aren't static anymore. Any error that happens during ssh_options_xxx()
+or ssh_connect() (i.e., outside of any session) can be retrieved by
+giving NULL as argument.
-*** To be written ***
@section threads Working with threads