Topic "Feature: Add More Exit Codes"

Author Message


This feature request would affect

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.


Also, it would be nice if errors were written to stderr.
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
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:

You can post new topics in this forum


What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License