Sha256: fb926957f3237dfaf0cf49a20b5d8a42a9144915e9c66e0ec6eb97945ce21db5
Contents?: true
Size: 1.28 KB
Versions: 2
Compression:
Stored size: 1.28 KB
Contents
# https://ruby-doc.org/core/Exception.html sez: # "It is recommended that a library should have one subclass of StandardError # or RuntimeError and have specific exception types inherit from it. # This allows the user to rescue a generic exception type to catch # all exceptions the library may raise even if future versions of # the library add new exception subclasses." class StandardDistorteDError < StandardError end # The built-in NotImplementedError is for "when a feature is not implemented # on the current platform", so make our own more appropriate ones. class MediaTypeNotImplementedError < StandardDistorteDError attr_reader :name def initialize(name) super @name = name end def message "No supported media type for #{name}" end end class MediaTypeOutputNotImplementedError < MediaTypeNotImplementedError attr_reader :type, :context def initialize(name, type, context) super(name) @type = type @context = context end def message "Unable to save #{name} as #{type.to_s} from #{context}" end end class MediaTypeNotFoundError < StandardDistorteDError attr_reader :name def initialize(name) super @name = name end def message "Failed to detect media type for #{name}" end end class OutOfDateLibraryError < LoadError end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
distorted-0.7.0 | lib/distorted/error_code.rb |
distorted-0.6.0 | lib/distorted/error_code.rb |