我有一个 SSIS foreach 循环容器,它使用 httpconneciton 管理器从 web 服务下载图像。
但是,如果图像不可用,则没有错误或超时。脚本进程在写入零长度文件的请求时永远挂起。没有要捕获的错误。
Dim connection As New HttpClientConnection(nativeObject)
connection.ServerURL = InputFile ' http://wwww.example.com/image?id=12345
Try
connection.DownloadFile(DestinationFile, True)
Dim info As New FileInfo(DestinationFile)
If File.Exists(DestinationFile) = False Or info.Length = 0 Then
Dts.TaskResult = ScriptResults.Failure
Return
End If
Catch ex As Exception
Dts.TaskResult = ScriptResults.Failure
End Try
Dts.TaskResult = ScriptResults.Success
任何人都可以弄清楚如何使这一步失败,以便我可以继续循环。