Skip to content

Commit 11259c8

Browse files
chris-luChristophe Dri
authored and
Christophe Dri
committed
Fixing ArgumentError on calling ErrorHandler.submit
1 parent 16c4498 commit 11259c8

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ script: bundle exec rake
66
before_install:
77
- sudo apt-get update -qq
88
- sudo apt-get install -qq libarchive-dev
9+
- gem update --system
10+
- gem install bundler
911

1012
rvm:
1113
- 2.1
@@ -18,8 +20,6 @@ notifications:
1820
on_success: change
1921
on_failure: change
2022

21-
cache: bundler
22-
2323
branches:
2424
only:
2525
- master

lib/opener/webservice/server.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ def analyze_async(options, request_id)
223223
# Submit the error to the error callback, re-raise so Rollbar can also
224224
# report it.
225225
rescue Exception => error
226-
ErrorHandler.new.submit(error, request_id) if options['error_callback']
226+
ErrorHandler.new.submit(error, request_id, options['error_callback']) if options['error_callback']
227227

228228
raise error
229229
end

opener-webservice.gemspec

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
2424
spec.add_dependency 'opener-core', '~> 2.3'
2525
spec.add_dependency 'puma'
2626
spec.add_dependency 'slop', '~> 3.0'
27+
spec.add_dependency 'aws-sdk-v1'
2728

2829
spec.add_dependency 'newrelic_rpm'
2930
spec.add_dependency 'rollbar', '~> 1.0'

spec/opener/webservice/server_spec.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
require 'spec_helper'
2+
require 'aws-sdk-v1'
23

34
describe Opener::Webservice::Server, :type => :request do
45
before do
@@ -174,7 +175,7 @@ def run(input)
174175

175176
context '#analyze_async' do
176177
before do
177-
@input = {'input' => 'Hello world', 'error_callback' => 'foo'}
178+
@input = {'input' => 'Hello world', 'error_callback' => 'http://foo'}
178179
end
179180

180181
example 'analyze the input and submit the output to a callback' do
@@ -187,7 +188,7 @@ def run(input)
187188
example 'submit errors to the error callback if present' do
188189
Opener::Webservice::ErrorHandler.any_instance
189190
.should_receive(:submit)
190-
.with(an_instance_of(StandardError), '123')
191+
.with(an_instance_of(StandardError), '123', 'http://foo')
191192

192193
@server.stub(:analyze).and_raise(StandardError)
193194

0 commit comments

Comments
 (0)