Sha256: 40dd2209f05c39b40c873ec4b1c65b57921fa1a6811a86e6ec3ee599cd24f314

Contents?: true

Size: 855 Bytes

Versions: 10

Compression:

Stored size: 855 Bytes

Contents

module Lucid
  module WireSupport
    # Proxy for an exception that occured at the remote end of the wire
    class WireException < StandardError
      module CanSetName
        attr_writer :exception_name
        def to_s
          @exception_name
        end
      end

      def initialize(args, config)
        super args['message']
        if args['exception']
          self.class.extend(CanSetName)
          self.class.exception_name = "#{args['exception']} from #{config}"
        end
        if args['backtrace']
          @backtrace = if args['backtrace'].is_a?(String)
              args['backtrace'].split("\n") # TODO: change cuke4nuke to pass an array instead of a big string
            else
              args['backtrace']
            end
        end
      end

      def backtrace
        @backtrace || super
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lucid-0.3.0 lib/lucid/wire_support/wire_exception.rb
lucid-0.2.1 lib/lucid/wire_support/wire_exception.rb
lucid-0.2.0 lib/lucid/wire_support/wire_exception.rb
lucid-0.1.1 lib/lucid/wire_support/wire_exception.rb
lucid-0.1.0 lib/lucid/wire_support/wire_exception.rb
lucid-0.0.9 lib/lucid/wire_support/wire_exception.rb
lucid-0.0.8 lib/lucid/wire_support/wire_exception.rb
lucid-0.0.7 lib/lucid/wire_support/wire_exception.rb
lucid-0.0.6 lib/lucid/wire_support/wire_exception.rb
lucid-0.0.5 lib/lucid/wire_support/wire_exception.rb