On Dec 7, 2009, at 5:12 AM, Alexander Lamaison wrote: > If it's just a matter of libssh2 cooking up separate error codes for > its different authentication methods, then I think we should revisit > the option of making them all return some common > LIBSSH2_ERROR_USERAUTH value. After all, that would be the protocol > error.
If you look at the SFTP subsystem, this is exactly what it does. API calls seem to return LIBSSH2_ERROR_SFTP_PROTOCOL which is fairly useless by itself, but by calling libssh2_sftp_last_error(<sftp_session>) you can get the actual LIBSSH2_FX_* error code back that'll tell you the actual SFTP error. Unfortunately, there's no part of this API to return the corresponding error text (at least that I've seen), so I have a table of error messages indexed by the LIBSSH2_FX_* code. _______________________________________________ libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
