Post a reply

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)


Topic review


Re: Error codes

Currently, the API offers the textual message only.

Yes, if you do not install any language the message will always be in English. In fact, when using WinSCP .NET assembly, you should not rely on an installed copy of WinSCP binaries. Deploy your app/script with its own copy of the binaries (without any languages).

Error codes

I am using WinSCP .NET assembly v5.17.10.
In all the tests I have done the error code returns as a string along with the description and message from the server.
Error code: 3
Error message from server: Permission denied.

Also this message will vary depending on the selected language.
Question1: Is there any way to return only the error code? My application, based on the error code returned by WinSCP, has to return an internal error code for the end user.
I understand that the only way to know the error code is to parse the string returned by winscp and look for the third part of the message "\n" to get the error code or look for the string "Error code:" and read the error code that follows.

Question 2: If I don't install any language, I understand that all exceptions messages will always be displayed in English, right?
If so, I can search for the string "Error code:" within the message.

Thank you very much.