Exception: Win32::NetResources::Error

Inherits:
StandardError
  • Object
show all
Defined in:
lib/Win32/NetResources.rb

Overview



Exceptions

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(p_e) ⇒ Error


class methodsFor: “initialization”



28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/Win32/NetResources.rb', line 28

def initialize(p_e)
	bInOLE = false
	@errno   = 0
	@error = ''
	p_e.to_s.each do |line|
		case line.chomp
			when /^\s*OLE error code:([0-9a-hA-H]+) in (\w+)\.(\w+)/
				@errno = $1.hex
				@OLEObject = $2
				@OLEMethod = $3
				bInOLE = true
			when /^\s+(.*)/ then @error += $1 + "\n" if bInOLE
			when /^$/       then bInOLE = false
		end
	end
	@error = @error.chomp
	super("0x%X" % @errno + ": " + @error)
end

Instance Attribute Details

#errnoObject (readonly)


attributesFor: “description”



24
25
26
# File 'lib/Win32/NetResources.rb', line 24

def errno
  @errno
end

#errorObject (readonly)


attributesFor: “description”



24
25
26
# File 'lib/Win32/NetResources.rb', line 24

def error
  @error
end

#OLEMethodObject (readonly)


attributesFor: “description”



24
25
26
# File 'lib/Win32/NetResources.rb', line 24

def OLEMethod
  @OLEMethod
end

#OLEObjectObject (readonly)


attributesFor: “description”



24
25
26
# File 'lib/Win32/NetResources.rb', line 24

def OLEObject
  @OLEObject
end

Instance Method Details

#to_iObject


methodsFor: “accessing”



49
50
51
# File 'lib/Win32/NetResources.rb', line 49

def to_i
	return @errno
end