Modify

Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#2711 closed Bug (Works For Me)

_IELoadWait() hung in case of unknown error

Reported by: anonymous Owned by:
Milestone: Component: Standard UDFs
Version: Other Severity: None
Keywords: Cc:

Description

I have Embedded IE and sometimes it error-out by showing "404" page not found. In this case _IELoadWait($oIE,0,3333) always hung forever.

It seems it happen because of some logic problem in Func IEComErrorUnrecoverable($i_error) as it return $_IEStatus_Success not only when @error=0, but also in case of all unknown errors.

In my case @error=1 and as result _IELoadWait() didn't check for timer to time-out going in infinite loop.

	Select
		Case __IEIsObjType($o_object, "browser"); Internet Explorer
			; ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : String($o_object.readyState) = ' & String($o_object.readyState) & @CRLF & '>Error code: ' & @error & '    Extended code: 0x' & Hex(@extended) & @CRLF) ;### Debug Console
			While Not (String($o_object.readyState) = "complete" Or $o_object.readyState = 4 Or $f_Abort)
				; Trap unrecoverable COM errors
				If @error Then
					$i_error = @error
					If __IEComErrorUnrecoverable($i_error) Then
						$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
						$f_Abort = True
					EndIf
				ElseIf (TimerDiff($IELoadWaitTimer) > $i_timeout) Then
					$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
					$f_Abort = True
				EndIf
				Sleep(100)
			WEnd
;----------------------------------------------------------------------------------

Func __IEComErrorUnrecoverable($i_error)
	Switch $i_error
		; Cross-domain scripting security error
		Case -2147352567 ; "an exception has occurred."
			Return $_IEStatus_AccessIsDenied
		Case -2147024891 ; "Access is denied."
			Return $_IEStatus_AccessIsDenied
			;
			; Browser object is destroyed before we try to operate upon it
		Case -2147417848 ; "The object invoked has disconnected from its clients."
			Return $_IEStatus_ClientDisconnected
		Case -2147023174 ; "RPC server not accessible."
			Return $_IEStatus_ClientDisconnected
		Case -2147023179 ; "The interface is unknown."
			Return $_IEStatus_ClientDisconnected
			;
		Case Else
			Return $_IEStatus_Success
	EndSwitch
EndFunc   ;==>__IEComErrorUnrecoverable

Attachments (0)

Change History (3)

comment:1 Changed 6 years ago by TicketCleanup

  • Version set to Other

Automatic ticket cleanup.

comment:2 Changed 6 years ago by guinness

  • Resolution set to Works For Me
  • Status changed from new to closed

comment:3 Changed 5 years ago by anonymous

why not change it to:

While Not (String($o_object.readyState) = "complete" Or $o_object.readyState = 4 Or $f_Abort)
	; Trap unrecoverable COM errors
	If @error Then
		$i_error = @error
		If __IEComErrorUnrecoverable($i_error) Then
			$i_ErrorStatusCode = __IEComErrorUnrecoverable($i_error)
			$f_Abort = True
		EndIf
	EndIf
	If (TimerDiff($IELoadWaitTimer) > $i_timeout) Then
		$i_ErrorStatusCode = $_IEStatus_LoadWaitTimeout
		$f_Abort = True
	EndIf
	Sleep(100)
WEnd

here timeout actually work as time out, is't?

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.