Topic "How to capture error code and error in ExecuteCommand"

Author Message
gauragarwal
[View user's profile]

Joined: 2014-09-22
Posts: 6
Location: Australia
Hi,

I am executing a Perl script on a remote server via "ExecuteCommand". The Perl script can return error and exit code <> 0. However, when ExecuteCommand sees an error or exit code <> 0, it raises SessionRemoteException and the result of the "ExecuteCommand" remains null. How can I capture the error and return code? I am using C#. NET and .NET assembly of Winscp.

Regards,
Gaurav
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
This issue has been added to the tracker:
http://winscp.net/tracker/show_bug.cgi?id=1225

I have sent you an email with a dev version of WinSCP to address you have used to register on this forum.
gauragarwal
[View user's profile]

Joined: 2014-09-22
Posts: 6
Location: Australia
Hi,

Thank you for your reply and looking into the issue. Really appreciate it. Can you also please send me winSCPnet.dll file compatible to the WinSCP.exe v5.6.2.0?

Regards,
Gaurav
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
gauragarwal wrote:
Thank you for your reply and looking into the issue. Really appreciate it. Can you also please send me winSCPnet.dll file compatible to the WinSCP.exe v5.6.2.0?

Sorry I've forgot about this. Sent now.
_________________
Martin Prikryl
gauragarwal
[View user's profile]

Joined: 2014-09-22
Posts: 6
Location: Australia
Sorry for getting back late. I was working on another area. I tried with the new files but it did not work. It still raise an exception. In Perl, the last statement called is die "error"
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Please set Session.DebugLogPath and attach the log file.
_________________
Martin Prikryl
gauragarwal
[View user's profile]

Joined: 2014-09-22
Posts: 6
Location: Australia
prikryl wrote:
Please set Session.DebugLogPath and attach the log file.



Here is the log file.
debug.log (55.64 KB) Private file

Description: (none)

martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
This is a log from release version of WinSCP, not from the dev version I've sent you.

Quote:
[2014-10-21 11:00:09.240Z] [0007] Executing Assembly: WinSCPnet, Version=1.2.1.4547, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf; Path: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.DLL; Location: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.dll; Product: 5.6.1.0
gauragarwal
[View user's profile]

Joined: 2014-09-22
Posts: 6
Location: Australia
prikryl wrote:
This is a log from release version of WinSCP, not from the dev version I've sent you.

Quote:
[2014-10-21 11:00:09.240Z] [0007] Executing Assembly: WinSCPnet, Version=1.2.1.4547, Culture=neutral, PublicKeyToken=2271ec4a3c56d0bf; Path: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.DLL; Location: C:\Users\gagar\Documents\Visual Studio 2010\Projects\PFLLoadToolApplication\PFLLoadToolApplication\bin\Debug\WinSCPnet.dll; Product: 5.6.1.0


My bad. Apologies. Thank you and really appreciate it. It works like a charm.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Thanks for your feedback. Official 5.6.2 beta is going to be released in few hours.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

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!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License