﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
3841	COM Error Handling	kAnon		"Error handler does not work with array elements.
{{{#!autoit
#include <StringConstants.au3>

test()

Func test()
    Local $oComError = ObjEvent('AutoIt.Error', onComError)
    #forceref $oComError

    Local $oObject
    Local $aoObjects[1]
    $oObject.TestComError() ; error handled
    $aoObjects[0].TestComError() ; error not handled
EndFunc   ;==>test

Func onComError($oComError)
    With $oComError
        ConsoleWrite(@ScriptName & ' (' & .ScriptLine & ') : ==> COM Error intercepted !' & @CRLF & _
                @TAB & '.Number:' & @TAB & @TAB & '0x' & Hex(.Number) & @CRLF & _
                @TAB & '.WinDescription:' & @TAB & StringStripWS(.WinDescription, BitOR($STR_STRIPLEADING, $STR_STRIPTRAILING, $STR_STRIPSPACES)) & @CRLF & _
                @TAB & '.Description:' & @TAB & @TAB & .Description & @CRLF & _
                @TAB & '.Source:' & @TAB & @TAB & .Source & @CRLF & _
                @TAB & '.HelpFile:' & @TAB & @TAB & .HelpFile & @CRLF & _
                @TAB & '.HelpContext:' & @TAB & @TAB & .HelpContext & @CRLF & _
                @TAB & '.LastDllError:' & @TAB & @TAB & .LastDllError & @CRLF & _
                @TAB & '.ScriptLine:' & @TAB & @TAB & .ScriptLine & @CRLF & _
                @TAB & '.RetCode:' & @TAB & @TAB & '0x' & Hex(.RetCode) & @CRLF & @CRLF)
        SetError(.Number)
    EndWith
EndFunc   ;==>onComError
}}}

Console output
{{{
... : ==> COM Error intercepted !
    .Number:         0x000000A9
    .WinDescription: Variable must be of type 'Object'.
    .Description:
    .Source:
    .HelpFile:
    .HelpContext:
    .LastDllError:   0
    .ScriptLine:     1
    .RetCode:        0x00000000

... (12) : ==> Variable must be of type ""Object"".:
$aoObjects[0].TestComError()
$aoObjects[0]^ ERROR
}}}

----
Windows 10 Pro 21H1 x64
AutoIt Version: 3.3.14.5 / 3.3.15.4"	Bug	closed		AutoIt	3.3.14.5	None	No Bug		
