﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
2024	Add AutoIt.Error object property for script or file name.	anonymous		"Reproducer (if necessary):

include.au3:
{{{
#include-once

Func _test()
  Local $oIE = ObjCreate(""InternetExplorer.Application.1"")

  $oIE.UnknownMethod
  Local $err = @error

  $oIE.Quit()

  Return SetError($err)
EndFunc
}}}

Main.au3:
{{{
#include ""include.au3""

Global $g_eventerror = 0
Global $oMyError = ObjEvent(""AutoIt.Error"", ""_MyErrFunc"")

_test()

If $g_eventerror Then
  $g_eventerror = 0
  MsgBox(0, ""AutoItCOM test"", ""Test passed: We got an error number: "" & @error)
Else
  MsgBox(0, ""AutoItCOM test"", ""Test failed!"")
EndIf

Exit

Func _MyErrFunc()
  ConsoleWrite(""We intercepted a COM Error !"" & @CRLF & @CRLF & _
      ""err.description is: "" & @TAB & $oMyError.description & @CRLF & _
      ""err.windescription:"" & @TAB & $oMyError.windescription & @CRLF & _
      ""err.number is: "" & @TAB & Hex($oMyError.number, 8) & @CRLF & _
      ""err.lastdllerror is: "" & @TAB & $oMyError.lastdllerror & @CRLF & _
      ""err.scriptline is: "" & @TAB & $oMyError.scriptline & @CRLF & _
      ""err.source is: "" & @TAB & $oMyError.source & @CRLF & _
      ""err.helpfile is: "" & @TAB & $oMyError.helpfile & @CRLF & _
      ""err.helpcontext is: "" & @TAB & $oMyError.helpcontext & @CRLF _
      ; Something like
;~    ""err.scriptname is: "" & @TAB & $oMyError.scriptname & @CRLF _
      )

  Local $err = $oMyError.number
  If $err = 0 Then $err = -1

  $g_eventerror = $err
EndFunc
}}}"	Feature Request	closed		AutoIt		None	Rejected		
