Unable to capture error - WeOnlyDo Discussion board

Unable to capture error (General questions)

by hit_arc, Monday, March 24, 2008, 13:44 (6088 days ago)

Hi,

I am using sftp.net. I am transferring some files from my local machine to remote machine using put file command but one of my file does not have enough privileges or rights assigned to it. So the account under which my application is running will not be able to access that file but my application is getting hanged it is not throwing any error using LastError property nor it is firing LoopErrorEvent.

Kindly help it's urgent. Thanks in advance.

Regards
Hitarc

Re: Unable to capture error

by wodDamir, Monday, March 24, 2008, 14:28 (6088 days ago) @ hit_arc

Hi Hitarc,

Are you using PutFile or PutFiles method? Also, are you using Blobking mode or non-blocking mode?

The LoopError Event is only triggered if you called the GetFiles method. In that case you should check the Args.Error object for error.

If you are using PutFile method, then you should check Done Event, and it's Args.Error object.

Can you try that?

Regards,
Damba

Re: Unable to capture error

by hit_arc, Tuesday, March 25, 2008, 05:48 (6087 days ago) @ wodDamir

Hi,

Well i am running with blocking = true with PutFiles method And i have used done_event also in the following manner but even this event is not getting triggered i am writing my sample code for better understanding

I have applied a break point on sftp_doneevent but that is not getting fired.

--Done Event
Private Sub Sftp_DoneEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SFTP.DoneArgs) Handles Sftp.DoneEvent
If (Args.Error Is Nothing) Then
errorLog = errorLog + Successfully Done
Else
errorLog = errorLog + Args.Error.Message()
End If
End Sub


--Loop Item Event
Private Sub Sftp_LoopItemEvent(ByVal Sender As Object, ByVal Args As WeOnlyDo.Client.SFTP.LoopArgs) Handles Sftp.LoopItemEvent
If ((Args.RemoteFile Is Nothing) Or (Args.LocalFile Is Nothing)) Then
Args.Skip = True
Else
If (processType = Get ) Then
Args.Skip = False
fileLog += Args.RemoteFile.ToString() + ,
ElseIf (processType = Put ) Then
Args.Skip = False
fileLog += Args.LocalFile.ToString() + ,
End If
End If
End Sub


processType is another variables i am setting before calling getfiles or putfiles.

While debugging the debugger is lost after End Sub of loop_itemevent is called for that particular file.

--PutFiles
Sftp.PutFiles(LocalDir, RemoteDir, maxLevel)

LocalDir, RemoteDir, maxLevel are string,string,integer variables resp.


Can anyone help me whats wrong with this code why the done_event is not getting fired in case of error. Like no permissions are assigned to one of the file on my local directory which i am moving to remote server using PutFiles.

Thanks & Regards
Archit agg [color=#abcdef]Text[/color] [color=#abcdef]Text[/color]

Re: Unable to capture error

by woddrazen, Tuesday, March 25, 2008, 13:36 (6087 days ago) @ hit_arc

Hi Archit,


I think I have already answer to your other forum post which have more or less same question.


Drazen