Sha256: 2bbbd897ee543d585b495e8bf2d850a82a3e5cf54b62e43d4c0c476c1bf6d429

Contents?: true

Size: 1022 Bytes

Versions: 24

Compression:

Stored size: 1022 Bytes

Contents

module Dynflow
  module Errors
    class RescueError < StandardError; end

    # placeholder in case the deserialized error is no longer available
    class UnknownError < StandardError
      def self.for_exception_class(class_name)
        Class.new(self) do
          define_singleton_method :name do
            class_name
          end
        end
      end

      def self.inspect
        "#{UnknownError.name}[#{name}]"
      end

      def self.to_s
        inspect
      end

      def inspect
        "#{self.class.inspect}: #{message}"
      end
    end

    class InactiveWorldError < Dynflow::Error
      def initialize(world)
        super("The world #{world.id} is not active (terminating or terminated)")
      end
    end

    class PersistenceError < Dynflow::Error
      def self.delegate(original_exception)
        self.new("caused by #{original_exception.class}: #{original_exception.message}").tap do |e|
          e.set_backtrace original_exception.backtrace
        end
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
dynflow-0.8.23 lib/dynflow/errors.rb
dynflow-0.8.22 lib/dynflow/errors.rb
dynflow-0.8.21 lib/dynflow/errors.rb
dynflow-0.8.20 lib/dynflow/errors.rb
dynflow-0.8.19 lib/dynflow/errors.rb
dynflow-0.8.18 lib/dynflow/errors.rb
dynflow-0.8.17 lib/dynflow/errors.rb
dynflow-0.8.16 lib/dynflow/errors.rb
dynflow-0.8.15 lib/dynflow/errors.rb
dynflow-0.8.14 lib/dynflow/errors.rb
dynflow-0.8.13 lib/dynflow/errors.rb
dynflow-0.8.12 lib/dynflow/errors.rb
dynflow-0.8.11 lib/dynflow/errors.rb
dynflow-0.8.10 lib/dynflow/errors.rb
dynflow-0.8.9 lib/dynflow/errors.rb
dynflow-0.8.8 lib/dynflow/errors.rb
dynflow-0.8.7 lib/dynflow/errors.rb
dynflow-0.8.6 lib/dynflow/errors.rb
dynflow-0.8.5 lib/dynflow/errors.rb
dynflow-0.8.4 lib/dynflow/errors.rb