Skip to content

Fixing ArgumentError on calling ErrorHandler.submit #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ script: bundle exec rake
before_install:
- sudo apt-get update -qq
- sudo apt-get install -qq libarchive-dev
- gem update --system
- gem install bundler

rvm:
- 2.1
Expand All @@ -18,8 +20,6 @@ notifications:
on_success: change
on_failure: change

cache: bundler

branches:
only:
- master
2 changes: 1 addition & 1 deletion lib/opener/webservice/server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ def analyze_async(options, request_id)
# Submit the error to the error callback, re-raise so Rollbar can also
# report it.
rescue Exception => error
ErrorHandler.new.submit(error, request_id) if options['error_callback']
ErrorHandler.new.submit(error, request_id, options['error_callback']) if options['error_callback']

raise error
end
Expand Down
1 change: 1 addition & 0 deletions opener-webservice.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ Gem::Specification.new do |spec|
spec.add_dependency 'opener-core', '~> 2.3'
spec.add_dependency 'puma'
spec.add_dependency 'slop', '~> 3.0'
spec.add_dependency 'aws-sdk-v1'

spec.add_dependency 'newrelic_rpm'
spec.add_dependency 'rollbar', '~> 1.0'
Expand Down
5 changes: 3 additions & 2 deletions spec/opener/webservice/server_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
require 'spec_helper'
require 'aws-sdk-v1'

describe Opener::Webservice::Server, :type => :request do
before do
Expand Down Expand Up @@ -174,7 +175,7 @@ def run(input)

context '#analyze_async' do
before do
@input = {'input' => 'Hello world', 'error_callback' => 'foo'}
@input = {'input' => 'Hello world', 'error_callback' => 'http://foo'}
end

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

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

Expand Down