Modify

Opened 9 years ago

Closed 8 years ago

Last modified 8 years ago

#2024 closed Feature Request (Rejected)

Add AutoIt.Error object property for script or file name.

Reported by: anonymous Owned by:
Milestone: Component: AutoIt
Version: Severity: None
Keywords: Cc:

Description

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

Attachments (0)

Change History (2)

comment:1 follow-up: Changed 8 years ago by trancexx

  • Resolution set to Rejected
  • Status changed from new to closed

Some time in the future you will see how meaningless that is.

comment:2 in reply to: ↑ 1 Changed 8 years ago by anonymous

Replying to trancexx:

Some time in the future you will see how meaningless that is.

Meanwhile, it's annoying to search in which file the offending line of code
resides; unless, of course, the dev team is working on a different paradigm for
trapping COM errors.

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

Action
as closed The ticket will remain with no owner.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.