# class DBus::ErrorMessage

### Public Class Methods

from_exception(ex) click to toggle source

        # File lib/dbus/message.rb
    254 def self.from_exception(ex)
    255   name = if ex.is_a? DBus::Error
    256            ex.name
    257          else
    258            "org.freedesktop.DBus.Error.Failed"
    259            # ex.class.to_s # RuntimeError is not a valid name, has no dot
    260          end
    261   description = ex.message
    262   msg = new(name, description)
    263   msg.add_param(DBus.type("as"), ex.backtrace)
    264   msg
    265 end

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

        # File lib/dbus/message.rb
    248 def initialize(error_name, description = nil)
    249   super(ERROR)
    250   @error_name = error_name
    251   add_param(Type::STRING, description) unless description.nil?
    252 end