Skip to content

Commit

Permalink
We now check HTTP response codes and raise.
Browse files Browse the repository at this point in the history
  • Loading branch information
dbalatero committed Jul 16, 2010
1 parent 49a2587 commit 3c03587
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.markdown
@@ -1,3 +1,4 @@
Next release
0.1.2
------------
* Fixed specs for Ruby 1.9.1, passed them.
* Make sure to check HTTP status and raise/pass errors for handling.
2 changes: 2 additions & 0 deletions lib/monster_mash/base.rb
Expand Up @@ -93,13 +93,15 @@ def self.execute(http_method, hydra, block, *args, &setup_block)
if hydra.nil?
# serial request.
response = request.run_serial_request
check_response_and_raise!(response)
request.handler.call(response)
else
# parallel hydra request.
typhoeus_request = request.build_request
typhoeus_request.on_complete do |response|
result, error = nil, nil
begin
check_response_and_raise!(response)
result = request.handler.call(response)
rescue => e
error = e
Expand Down

0 comments on commit 3c03587

Please sign in to comment.