Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

modified connection:didFailWithError to call the delegator if one exists #18

Merged
merged 1 commit into from

2 participants

@dcampano

This look good? Pretty simple fix, I also marked the request as done_loading

@mattetti mattetti merged commit e5c7e62 into rubymotion:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/http.rb
View
6 lib/http.rb
@@ -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
Something went wrong with that request. Please try again.