Skip to content

Commit ac33af9

Browse files
committed
Merge pull request #198 from seancribbs/exception-handling
update exception handling
2 parents 4346862 + 3e561c5 commit ac33af9

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/webmachine/decision/fsm.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def run
3737
raise InvalidResource, t('fsm_broke', :state => state, :result => result.inspect)
3838
end
3939
end
40-
rescue Exception => e
40+
rescue => e
4141
Webmachine.render_error(500, request, response, :message => e.message)
4242
ensure
4343
trace_response(response)
@@ -50,7 +50,7 @@ def handle_exceptions
5050
rescue MalformedRequest => e
5151
Webmachine.render_error(400, request, response, :message => e.message)
5252
400
53-
rescue Exception => e
53+
rescue => e
5454
resource.handle_exception(e)
5555
500
5656
end

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)