Exception: Win32::Error

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

Overview



Win32 Exceptions

Direct Known Subclasses

RegistryError

Instance Method Summary collapse

Constructor Details

#initialize(p_nError = nil) ⇒ Error


class methodsFor: “initialization”



26
27
28
29
30
31
32
33
34
35
# File 'lib/Win32/Base.rb', line 26

def initialize(p_nError = nil)
	$TRACE.debug 9, "p_nError = '#{p_nError}'"
	@err = LastErrorInfo.new()
	if p_nError.kind_of?(String) then
		@err_string = p_nError
		$TRACE.debug 9, "@err_string = '#{@err_string}'"
	else
		@err.set(p_nError) if !p_nError.nil?
	end
end

Instance Method Details

#errnoObject


methodsFor: “accessing”



39
40
41
# File 'lib/Win32/Base.rb', line 39

def errno
	return @err.to_i
end

#messageObject



54
55
56
# File 'lib/Win32/Base.rb', line 54

def message
	self.to_s
end

#to_sObject


methodsFor: “printing”



45
46
47
48
49
50
51
52
# File 'lib/Win32/Base.rb', line 45

def to_s
	$TRACE.debug 9, "@err_string = '#{@err_string}'"
	if @err_string then
		return @err_string + @err.to_s
	else
		return @err.to_s
	end
end