Modify

Opened 9 years ago

Closed 9 years ago

#3098 closed Feature Request (Rejected)

ObjEvent - @error - when no ErrorHanlder registered

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

Description

Please add feature which set @error to non-zero values when using:
$sMyError = ObjEvent("AutoIt.Error")

And there is no one COMErrorHandler registered/defined

Example:

Global $sMyError

$sMyError = ObjEvent("AutoIt.Error")
MsgBox(0, 'No COMErrorHandler Registered: @error', _
	'@error = ' & @error & @CRLF & _
	'$sMyError =' &$sMyError  & '='& @CRLF & _
	'VarGetType($sMyError) = ' & VarGetType($sMyError) _
	)

Global $oMyErrorHandler = ObjEvent("AutoIt.Error",'COMErrorHandler')

$sMyError = ObjEvent("AutoIt.Error")
MsgBox(0, 'With COMErrorHandler Registered: @error', _
	'@error = ' & @error & @CRLF & _
	'$sMyError =' &$sMyError  & '='& @CRLF & _
	'VarGetType($sMyError) = ' & VarGetType($sMyError) _
	)

Func COMErrorHandler()
EndFunc

Attachments (0)

Change History (1)

comment:1 Changed 9 years ago by BrewManNH

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

It's not an error to use it that way, it is how the function works. It will return the error handler function name, if no function is assigned yet, that string will be empty.

It's up to the programmer to properly register their error handler function, and should use this return value to identify whether or not they've done so. I don't see any error condition that needs to be reported on.

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.