Sha256: 679007c37a49bb734e99ed2ece92197b911cf56fa908dca5b472148c89f41936

Contents?: true

Size: 1.15 KB

Versions: 20

Compression:

Stored size: 1.15 KB

Contents

module ASIR
  # Generic API error.
  class Error < ::Exception
    # Subclass should override method.
    class SubclassResponsibility < self; end

    # Unsupported Feature.
    class Unsupported < self; end

    # Unimplemented Feature
    class Unimplemented < self; end

    # Requested Stop.
    class Terminate < self; end

    # Unforwardable Exception.
    #
    # This encapsulates an Exception that should never be
    # forwarded and re-thrown directly in the client.
    # E.g.: SystemExit, Interrupt.
    class Unforwardable < self
      attr_accessor :original
      def initialize msg, original = nil, *args
        if ::Exception === msg
          original ||= msg
          msg = "#{original.class.name} #{msg.message}"
        end
        @original = original
        super(msg)
        self.set_backtrace original && original.backtrace
      end
      def self.unforwardable;    @@unforwardable; end
      def self.unforwardable= x; @@unforwardable = x; end
      @@unforwardable ||= [
        ::SystemExit,
        ::SystemStackError,
        ::NoMemoryError,
        ::Interrupt,
        ::SignalException,
        Error::Terminate,
      ]
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
asir-1.2.1 lib/asir/error.rb
asir-1.2.0 lib/asir/error.rb
asir-1.1.12 lib/asir/error.rb
asir-1.1.11 lib/asir/error.rb
asir-1.1.10 lib/asir/error.rb
asir-1.1.9 lib/asir/error.rb
asir-1.1.8 lib/asir/error.rb
asir-1.1.7 lib/asir/error.rb
asir-1.1.6 lib/asir/error.rb
asir-1.1.5 lib/asir/error.rb
asir-1.1.4 lib/asir/error.rb
asir-1.1.3 lib/asir/error.rb
asir-1.1.2 lib/asir/error.rb
asir-1.1.1 lib/asir/error.rb
asir-1.1.0 lib/asir/error.rb
asir-1.0.8 lib/asir/error.rb
asir-1.0.7 lib/asir/error.rb
asir-1.0.6 lib/asir/error.rb
asir-1.0.5 lib/asir/error.rb
asir-1.0.4 lib/asir/error.rb