# class DBus::ErrorMessage

### Public Class Methods

from_exception(ex) click to toggle source

    # File lib/dbus/message.rb, line 263
    def self.from_exception(ex)
      name = if ex.is_a? DBus::Error
               ex.name
             else
               "org.freedesktop.DBus.Error.Failed"
               # ex.class.to_s # RuntimeError is not a valid name, has no dot
             end
      description = ex.message
      msg = self.new(name, description)
      msg.add_param(DBus.type("as"), ex.backtrace)
      msg
    end

new(error_name, description=nil) click to toggle source
Calls superclass method DBus::Message.new

    # File lib/dbus/message.rb, line 255
    def initialize(error_name, description=nil)
      super(ERROR)
      @error_name = error_name
      unless description.nil?
        add_param(Type::STRING, description)
      end
    end