# class DBus::Error

Represents a D-Bus `Error`, both on the client and server side.

### Attributes

dbus_message[R]

for received errors, the raw D-Bus message

name[R]

error_name. `message` is inherited from `Exception`

### Public Class Methods

new(msg, name = "org.freedesktop.DBus.Error.Failed") click to toggle source

If `msg` is a `DBus::Message`, its contents is used for initialization. Otherwise, `msg` is taken as a string and `name` is used.

Calls superclass method

       # File lib/dbus/error.rb
    21 def initialize(msg, name = "org.freedesktop.DBus.Error.Failed")
    22   if msg.is_a? DBus::Message
    23     @dbus_message = msg
    24     @name = msg.error_name
    25     super(msg.params[0]) # or nil
    26     if msg.params[1].is_a? Array
    27       set_backtrace msg.params[1]
    28     end
    29   else
    30     @name = name
    31     super(msg)
    32   end
    33   # TODO: validate error name
    34 end