Why are error codes not documented?
GajenderI opened this issue · 5 comments
GajenderI commented
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
.
GajenderI commented
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
theophilusx commented
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.
GajenderI commented
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.
theophilusx commented
If you look at the code the ssh2-sftp-client, you will see it is very
small, less than 2k lines in fact. You will also see there are only 7 error
codes actually defined by this module. All the codes are defined in the
constats.js file, so I'm pretty sure you can work out all the
ssh2-shft-client defined codes with out much effort. As for the rest of the
codes, all those defined by either node or ssh2, that would be a question
for those projects to answer.
…On Mon, 22 Jul 2024 at 20:29, Gajender Tyagi ***@***.***> wrote:
I understand, but how can I be sure I have covered all the codes?
—
Reply to this email directly, view it on GitHub
<#547 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAMFIKOLZIGDNRLYWRA4Z73ZNTNINAVCNFSM6AAAAABLHW5WRCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBSGYZDKMZTGY>
.
You are receiving this because you modified the open/close state.Message
ID: ***@***.***>
--
regards,
Tim
--
Tim Cross
GajenderI commented
Thank you :)