Exception: COM::MethodInvocationError

Inherits:
Error
  • Object
show all
Extended by:
PatternError
Defined in:
lib/com/methodinvocationerror.rb

Overview

Represents an COM method invocation error.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from PatternError

replaces?

Methods inherited from Error

from, replaces?

Constructor Details

#initialize(message, method = '', server = '', code = -1,, hresult_code = -1,, hresult_message = '') ⇒ MethodInvocationError

Creates a new COM::MethodInvocationError with message.

Parameters:

  • message (#to_str)

    Error message

  • method (String) (defaults to: '')

    Method error occurred in

  • server (String) (defaults to: '')

    Server error occurred in

  • code (Integer) (defaults to: -1,)

    COM error code

  • hresult_code (Integer) (defaults to: -1,)

    HRESULT error code

  • hresult_message (String) (defaults to: '')

    HRESULT error message



30
31
32
33
34
35
# File 'lib/com/methodinvocationerror.rb', line 30

def initialize(message, method = '', server = '', code = -1,
               hresult_code = -1, hresult_message = '')
  super message
  @method, @server, @code, @hresult_code, @hresult_message =
    method, server, code, hresult_code, hresult_message
end

Instance Attribute Details

#codeObject (readonly)

Returns the value of attribute code.



37
38
39
# File 'lib/com/methodinvocationerror.rb', line 37

def code
  @code
end

#hresult_codeObject (readonly)

Returns the value of attribute hresult_code.



37
38
39
# File 'lib/com/methodinvocationerror.rb', line 37

def hresult_code
  @hresult_code
end

#hresult_messageObject (readonly)

Returns the value of attribute hresult_message.



37
38
39
# File 'lib/com/methodinvocationerror.rb', line 37

def hresult_message
  @hresult_message
end

#methodObject (readonly)

Returns the value of attribute method.



37
38
39
# File 'lib/com/methodinvocationerror.rb', line 37

def method
  @method
end

#serverObject (readonly)

Returns the value of attribute server.



37
38
39
# File 'lib/com/methodinvocationerror.rb', line 37

def server
  @server
end

Class Method Details

.replace(error) ⇒ Object

This is an internal method used by COM::Error.



16
17
18
19
# File 'lib/com/methodinvocationerror.rb', line 16

def replace(error)
  m = pattern.match(error.message)
  new(m[4], m[1], m[3], m[2].to_i(16), m[5].to_i(16), m[6])
end