Error codes

Advertisement

leire.astarloa
Guest

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.
Example:
Permissiondenied
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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

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).

Reply with quote

Advertisement

You can post new topics in this forum