Skip to content

Commit bc71df1

Browse files
committed
Add common ancestor to Concurrent errors
1 parent 7f4c3a7 commit bc71df1

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

lib/concurrent/errors.rb

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
11
module Concurrent
22

3+
Error = Class.new(StandardError)
4+
35
# Raised when errors occur during configuration.
4-
ConfigurationError = Class.new(StandardError)
6+
ConfigurationError = Class.new(Error)
57

68
# Raised when an asynchronous operation is cancelled before execution.
7-
CancelledOperationError = Class.new(StandardError)
9+
CancelledOperationError = Class.new(Error)
810

911
# Raised when a lifecycle method (such as `stop`) is called in an improper
1012
# sequence or when the object is in an inappropriate state.
11-
LifecycleError = Class.new(StandardError)
13+
LifecycleError = Class.new(Error)
1214

1315
# Raised when an attempt is made to violate an immutability guarantee.
14-
ImmutabilityError = Class.new(StandardError)
16+
ImmutabilityError = Class.new(Error)
1517

1618
# Raised when an object's methods are called when it has not been
1719
# properly initialized.
18-
InitializationError = Class.new(StandardError)
20+
InitializationError = Class.new(Error)
1921

2022
# Raised when an object with a start/stop lifecycle has been started an
2123
# excessive number of times. Often used in conjunction with a restart
2224
# policy or strategy.
23-
MaxRestartFrequencyError = Class.new(StandardError)
25+
MaxRestartFrequencyError = Class.new(Error)
2426

2527
# Raised when an attempt is made to modify an immutable object
2628
# (such as an `IVar`) after its final state has been set.
27-
MultipleAssignmentError = Class.new(StandardError)
29+
MultipleAssignmentError = Class.new(Error)
2830

2931
# Raised by an `Executor` when it is unable to process a given task,
3032
# possibly because of a reject policy or other internal error.
31-
RejectedExecutionError = Class.new(StandardError)
33+
RejectedExecutionError = Class.new(Error)
3234

3335
# Raised when any finite resource, such as a lock counter, exceeds its
3436
# maximum limit/threshold.
35-
ResourceLimitError = Class.new(StandardError)
37+
ResourceLimitError = Class.new(Error)
3638

3739
# Raised when an operation times out.
38-
TimeoutError = Class.new(StandardError)
40+
TimeoutError = Class.new(Error)
3941

4042
end

0 commit comments

Comments
 (0)