### Home Classes Methods

### In Files

- lib/dbus/message.rb

### Parent

DBus::Message

### Methods

- ::from_exception
- ::new

### Files

- README

### Class/Module Index

Quicksearch

- DBus
- DBus::ASessionBus
- DBus::ASystemBus
- DBus::AuthenticationFailed
- DBus::Authenticator
- DBus::Client
- DBus::Connection
- DBus::Connection::NameRequestError
- DBus::DBusCookieSHA1
- DBus::Error
- DBus::ErrorMessage
- DBus::External
- DBus::FormalParameter
- DBus::IncompleteBufferException
- DBus::Interface
- DBus::InterfaceElement
- DBus::IntrospectXMLParser
- DBus::InvalidClassDefinition
- DBus::InvalidDestinationName
- DBus::InvalidIntrospectionData
- DBus::InvalidMethodName
- DBus::InvalidPacketException
- DBus::InvalidParameters
- DBus::Main
- DBus::MatchRule
- DBus::MatchRuleException
- DBus::Message
- DBus::Method
- DBus::MethodNotImplemented
- DBus::MethodReturnMessage
- DBus::Node
- DBus::Object
- DBus::Object::UndefinedInterface
- DBus::PacketMarshaller
- DBus::PacketUnmarshaller
- DBus::ProxyObject
- DBus::ProxyObjectFactory
- DBus::ProxyObjectInterface
- DBus::RemoteBus
- DBus::Service
- DBus::SessionBus
- DBus::Signal
- DBus::SystemBus
- DBus::Type
- DBus::Type::Parser
- DBus::Type::SignatureException
- DBus::Type::Type
- DBus::TypeException
- DBus::UnknownSignal
- Integer

No matching classes.

# DBus::ErrorMessage

### Public Class Methods

from_exception(ex) click to toggle source

    # File lib/dbus/message.rb, line 297
    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

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

[Validate]

Generated with the Darkfish Rdoc Generator 2.