# class DBus::ErrorMessage

### Public Class Methods

from_exception(exc) click to toggle source

        # File lib/dbus/message.rb
    263 def self.from_exception(exc)
    264   name = if exc.is_a? DBus::Error
    265            exc.name
    266          else
    267            "org.freedesktop.DBus.Error.Failed"
    268            # exc.class.to_s # RuntimeError is not a valid name, has no dot
    269          end
    270   description = exc.message
    271   msg = new(name, description)
    272   msg.add_param(DBus.type("as"), exc.backtrace)
    273   msg
    274 end

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

        # File lib/dbus/message.rb
    257 def initialize(error_name, description = nil)
    258   super(ERROR)
    259   @error_name = error_name
    260   add_param(Type::STRING, description) unless description.nil?
    261 end