Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Feature: Add More Exit Codes

Well, I'm not sure the additional exit codes are useful enough to justify that the change possible breaks scripts of many users.

Suggestion to print errors on stderr is good. But again, probably optionally only. I have to think about it.

Add to tracker:
https://winscp.net/tracker/742
https://winscp.net/tracker/741
tperk

Also, it would be nice if errors were written to stderr.
tperk

Feature: Add More Exit Codes

This feature request would affect WinSCP.com.

When WinSCP or a script fails the exit code is 1 instead of 0. If the user wants to know how the script failed, they must grep the output or parse the XML log. Depending on the environment, this can be somewhat difficult. IMHO, it would be beneficial to have more error codes, so that user can immediately know why their script has failed.

Maybe three exit codes could be used: 0 for normal, 1 for SSH/SFTP related errors (network, protocol, etc), and 2 for script errors (bad command syntax and/or bad exit codes from "call"s). Something like that.