Sha256: 502cdc314c90f01bc314eaeacafe9ead01b8090eaa7e78a9b853b2f3f12e8d2b

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

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 DataConsistencyError < Dynflow::Error
    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

21 entries across 21 versions & 1 rubygems

Version Path
dynflow-1.1.0 lib/dynflow/errors.rb
dynflow-1.0.5 lib/dynflow/errors.rb
dynflow-1.0.4 lib/dynflow/errors.rb
dynflow-1.0.3 lib/dynflow/errors.rb
dynflow-1.0.2 lib/dynflow/errors.rb
dynflow-1.0.1 lib/dynflow/errors.rb
dynflow-1.0.0 lib/dynflow/errors.rb
dynflow-0.8.37 lib/dynflow/errors.rb
dynflow-0.8.36 lib/dynflow/errors.rb
dynflow-0.8.35 lib/dynflow/errors.rb
dynflow-0.8.34 lib/dynflow/errors.rb
dynflow-0.8.33 lib/dynflow/errors.rb
dynflow-0.8.32 lib/dynflow/errors.rb
dynflow-0.8.31 lib/dynflow/errors.rb
dynflow-0.8.30 lib/dynflow/errors.rb
dynflow-0.8.29 lib/dynflow/errors.rb
dynflow-0.8.28 lib/dynflow/errors.rb
dynflow-0.8.27 lib/dynflow/errors.rb
dynflow-0.8.26 lib/dynflow/errors.rb
dynflow-0.8.25 lib/dynflow/errors.rb