File tree Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Expand file tree Collapse file tree 3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -212,7 +212,11 @@ require "crystal/system/time"
212212# elapsed_time # => 20.milliseconds (approximately)
213213# ```
214214struct Time
215- class FloatingTimeConversionError < Exception
215+ # Raised when an error occurs while performing a `Time` based operation.
216+ class Error < Exception
217+ end
218+
219+ class FloatingTimeConversionError < Error
216220 end
217221
218222 include Comparable (Time )
Original file line number Diff line number Diff line change @@ -51,7 +51,7 @@ class Time::Location
5151 # the time zone database.
5252 #
5353 # See `Time::Location.load` for details.
54- class InvalidLocationNameError < Exception
54+ class InvalidLocationNameError < Time::Error
5555 getter name, source
5656
5757 def initialize (@name : String , @source : String ? = nil )
@@ -63,7 +63,7 @@ class Time::Location
6363
6464 # `InvalidTimezoneOffsetError` is raised if `Time::Location::Zone.new`
6565 # receives an invalid time zone offset.
66- class InvalidTimezoneOffsetError < Exception
66+ class InvalidTimezoneOffsetError < Time::Error
6767 def initialize (offset : Int )
6868 super " Invalid time zone offset: #{ offset } "
6969 end
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ class Time::Location
55 # time zone data.
66 #
77 # Details on the exact cause can be found in the error message.
8- class InvalidTZDataError < Exception
8+ class InvalidTZDataError < Time::Error
99 def self.initialize (message : String ? = " Malformed time zone information" , cause : Exception ? = nil )
1010 super (message, cause)
1111 end
You can’t perform that action at this time.
0 commit comments