Class: LiveIdentity::Identity::ExtendedError
- Inherits:
-
Object
- Object
- LiveIdentity::Identity::ExtendedError
- Defined in:
- lib/live_identity.rb
Instance Attribute Summary collapse
-
#Category ⇒ Object
readonly
Returns the value of attribute Category.
-
#Error ⇒ Object
readonly
Returns the value of attribute Error.
-
#ErrorBlob ⇒ Object
readonly
Returns the value of attribute ErrorBlob.
-
#ErrorBlobXML ⇒ Object
readonly
Returns the value of attribute ErrorBlobXML.
Instance Method Summary collapse
- #BlobResponse ⇒ Object
- #BlobResponseError ⇒ Object
-
#initialize(identity) ⇒ ExtendedError
constructor
A new instance of ExtendedError.
- #to_s ⇒ Object
Constructor Details
#initialize(identity) ⇒ ExtendedError
Returns a new instance of ExtendedError.
542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 |
# File 'lib/live_identity.rb', line 542 def initialize(identity) @Category = nil @Error = nil @ErrorBlob = nil @ErrorBlobXML = nil hIdentity = identity.hIdentity pdwCategory = FFI::MemoryPointer.new(:PDWORD) pdwError = FFI::MemoryPointer.new(:PDWORD) pszErrorBlob = FFI::MemoryPointer.new(:LPWSTR) hr = IDCRL.GetExtendedError(hIdentity, nil, pdwCategory, pdwError, pszErrorBlob) raise LiveIdentityError.new(hr) if LiveIdentity::IsError?(hr) @Category = pdwCategory.read_uint @Error = pdwError.read_uint @ErrorBlob = read_wide_string(pszErrorBlob.read_pointer) @ErrorBlobXML = Nokogiri::XML(@ErrorBlob) LiveIdentity::FreeMemory(pszErrorBlob.read_pointer) end |
Instance Attribute Details
#Category ⇒ Object (readonly)
Returns the value of attribute Category.
538 539 540 |
# File 'lib/live_identity.rb', line 538 def Category @Category end |
#Error ⇒ Object (readonly)
Returns the value of attribute Error.
539 540 541 |
# File 'lib/live_identity.rb', line 539 def Error @Error end |
#ErrorBlob ⇒ Object (readonly)
Returns the value of attribute ErrorBlob.
540 541 542 |
# File 'lib/live_identity.rb', line 540 def ErrorBlob @ErrorBlob end |
#ErrorBlobXML ⇒ Object (readonly)
Returns the value of attribute ErrorBlobXML.
541 542 543 |
# File 'lib/live_identity.rb', line 541 def ErrorBlobXML @ErrorBlobXML end |
Instance Method Details
#BlobResponse ⇒ Object
560 561 562 563 |
# File 'lib/live_identity.rb', line 560 def BlobResponse return unless @ErrorBlobXML @BlobResponse ||= Nokogiri::XML(@ErrorBlobXML.xpath('/IDCRLErrorInfo/Response').first.content) end |
#BlobResponseError ⇒ Object
565 566 567 568 569 570 571 572 573 574 |
# File 'lib/live_identity.rb', line 565 def BlobResponseError response = BlobResponse() reasonText = response.xpath('//S:Fault/S:Reason/S:Text').first.content errorValue = response.xpath('//S:Fault/S:Detail/psf:error/psf:value').first.content.strip.to_i(16) internalError = response.xpath('//S:Fault/S:Detail/psf:error/psf:internalerror/psf:code').first.content.strip.to_i(16) internalErrorText = response.xpath('//S:Fault/S:Detail/psf:error/psf:internalerror/psf:text').first.content.strip "ReasonText: #{reasonText}\n" + "ErrorValue: #{WinCommon::Errors::HRESULT::GetNameCode(errorValue)}\n" + "InternalError: #{internalErrorText} #{WinCommon::Errors::HRESULT::GetNameCode(internalError)}\n" end |
#to_s ⇒ Object
576 577 578 579 |
# File 'lib/live_identity.rb', line 576 def to_s "Category: #{IDCRL::IDCRL_ERROR_CATEGORY.to_h[@Category]} (#{@Category})\n" + "Error: #{WinCommon::Errors::HRESULT::GetNameCode(@Error)}\n" + BlobResponseError() end |