Skip to content

Commit ebccb7c

Browse files
committed
Merge branch 'master' into less-object-allocations
2 parents 395f7a2 + 7ccf8c3 commit ebccb7c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

lib/webmachine/decision/fsm.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def run
3838
raise InvalidResource, t('fsm_broke', :state => state, :result => result.inspect)
3939
end
4040
end
41-
rescue Exception => e
41+
rescue => e
4242
Webmachine.render_error(500, request, response, :message => e.message)
4343
ensure
4444
trace_response(response)
@@ -51,7 +51,7 @@ def handle_exceptions
5151
rescue MalformedRequest => e
5252
Webmachine.render_error(400, request, response, :message => e.message)
5353
400
54-
rescue Exception => e
54+
rescue => e
5555
resource.handle_exception(e)
5656
500
5757
end

lib/webmachine/translation.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require 'set'
12
require 'i18n'
23
I18n.enforce_available_locales = true if I18n.respond_to?(:enforce_available_locales)
34
I18n.config.load_path << File.expand_path("../locale/en.yml", __FILE__)

spec/webmachine/decision/fsm_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
subject { described_class.new(resource, request, response) }
77

88
describe 'handling of exceptions from decision methods' do
9-
let(:exception) { Exception.new }
9+
let(:exception) { RuntimeError.new }
1010

1111
before do
1212
allow(subject).to receive(Webmachine::Decision::Flow::START) { raise exception }
@@ -24,7 +24,7 @@
2424
end
2525

2626
describe 'handling of exceptions from resource.handle_exception' do
27-
let(:exception) { Exception.new('an error message') }
27+
let(:exception) { RuntimeError.new('an error message') }
2828

2929
before do
3030
allow(subject).to receive(Webmachine::Decision::Flow::START) { raise }
@@ -50,7 +50,7 @@
5050
end
5151

5252
describe 'handling of exceptions from resource.finish_request' do
53-
let(:exception) { Exception.new }
53+
let(:exception) { RuntimeError.new }
5454

5555
before do
5656
allow(resource).to receive(:finish_request) { raise exception }

0 commit comments

Comments
 (0)