Sha256: a3676e332bd6bb017944dddd788a5f8ce8f80c23da845c2c47dc1fbc4e7c1ed9

Contents?: true

Size: 847 Bytes

Versions: 4

Compression:

Stored size: 847 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 PersistenceError < StandardError
      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

4 entries across 4 versions & 1 rubygems

Version Path
dynflow-0.7.9 lib/dynflow/errors.rb
dynflow-0.7.8 lib/dynflow/errors.rb
dynflow-0.7.7 lib/dynflow/errors.rb
dynflow-0.7.6 lib/dynflow/errors.rb