libssh2 / libssh2

the SSH library

Home Page:https://libssh2.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How can I get more descriptive error messages?

aguaviva opened this issue · comments

Describe the bug
Using sftp I tried to read a a file for which I have no permissions. I could libssh2_sftp_open and libssh2_sftp_stat fine, but libssh2_sftp_read returned LIBSSH2_ERROR_BAD_USE

Expected behavior
The error I got was too generic. I was expecting to be able to get a more descriptive error that helps the user overcome the issue (i.e: "not enough permissions"), is it possible to get such an error? If so, how?

Many thanks