File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -87,8 +87,7 @@ def self.current=(transaction)
87
87
88
88
end
89
89
90
- class AbortException < Exception
91
- end
90
+ AbortError = Class . new ( StandardError )
92
91
93
92
def atomically
94
93
raise ArgumentError . new ( 'no block given' ) unless block_given?
@@ -116,7 +115,7 @@ def atomically
116
115
117
116
begin
118
117
result = yield
119
- rescue AbortException => e
118
+ rescue AbortError => e
120
119
transaction . abort
121
120
result = ABORTED
122
121
rescue => e
@@ -144,7 +143,7 @@ def atomically
144
143
end
145
144
146
145
def abort_transaction
147
- raise AbortException . new
146
+ raise AbortError . new
148
147
end
149
148
150
149
module_function :atomically , :abort_transaction
Original file line number Diff line number Diff line change @@ -129,7 +129,7 @@ module Concurrent
129
129
describe '#abort_transaction' do
130
130
131
131
it 'raises an exception outside an #atomically block' do
132
- expect { Concurrent ::abort_transaction } . to raise_error ( Concurrent ::AbortException )
132
+ expect { Concurrent ::abort_transaction } . to raise_error ( Concurrent ::AbortError )
133
133
end
134
134
135
135
end
You can’t perform that action at this time.
0 commit comments