theophilusx/ssh2-sftp-client

Why are error codes not documented?

GajenderI opened this issue · 5 comments

Whenever an error is thrown we get the error message and error code, but why is it not documented somewhere so that a developer can handle all possible scenarios and avoid any surprises? I don't want to go with handling all error similar in catch clock. Some error codes - ERR_GENERIC_CLIENT ECONNREFUSED -2 for bad path.

Some of the error code

'ECONNREFUSED' - bad url 
'ERR_GENERIC_CLIENT'  - bad creds , bad port
‘-2’ - bad path (source file not found)
‘2’ - bad destn. (Destination file path not valid)
‘3’ - dest permission denied 

‘EACCES’ source access denied

It isn't documented because nobody has stepped up to do it. Feel free to submit a PR. This is op;en source, you have to scratch your own itch.

I understand, but how can I be sure I have covered all the codes? Someone from the dev team would know or I'll have to scan the code for that.

Thank you :)