Permalink
Browse files

Merge pull request #18 from dcampano/master

modified connection:didFailWithError to call the delegator if one exists
  • Loading branch information...
mattetti committed May 11, 2012
2 parents d927271 + dee87f3 commit e5c7e628e4f8b9a6b48ac9963fedda84181f61d9
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/http.rb
View
@@ -182,8 +182,12 @@ def connection(connection, willSendRequest:request, redirectResponse:redirect_re
end
def connection(connection, didFailWithError: error)
+ @request.done_loading!
p "HTTP Connection failed #{error.localizedDescription}"
- response.error_message = error.localizedDescription
+ @response.error_message = error.localizedDescription
+ if @delegator.respond_to?(:call)
+ @delegator.call( @response, self )
+ end
end
# The transfer is done and everything went well

0 comments on commit e5c7e62

Please sign in to comment.