Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
countWorking = countWorking - 1
finishTasks = finishTasks + 1
HandleError(TaskId, Reason)
If Response <> Null Then
Log(Response.GetString("UTF8"))
Response.Release
End If
Log("Error")
Log(StatusCode)
If Floor(StatusCode / 100) = 3 Then '3xx status
If Response <> Null Then
Log("Redirect to: " & Response.GetHeaders.Get("Location"))
End If
End If
ProcessNextTask
End Sub