Sha256: 1ead6b290ec7920bc1be06be703274c4fae43a956cb49f56c0b82192bc18fee4
Contents?: true
Size: 984 Bytes
Versions: 8
Compression:
Stored size: 984 Bytes
Contents
module Cassanity class Error < StandardError # Public: The original error this exception is wrapping. attr_reader :original # Public: Initializes an Error. # # args - The Hash of arguments. # :original - The Exception being wrapped (optional). # # Returns the duplicated String. def initialize(args = {}) if args.is_a?(String) @message = args else @original = args.fetch(:original) { $! } @message = args.fetch(:message) { if @original "Original Exception: #{@original.class}: #{@original.message}" else "Something truly horrible went wrong" end } end super @message end end # Raised when an argument generator is asked to perform an unknown command. UnknownCommand = Class.new(Error) # Raised when a migration operation is attempted that is not supported. MigrationOperationNotSupported = Class.new(Error) end
Version data entries
8 entries across 8 versions & 1 rubygems