Mombu the Microsoft Forum sponsored links

Go Back   Mombu the Microsoft Forum > Microsoft > JScript throw and error number
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 1st May 22:02
lkurts
External User
 
Posts: 1
Default JScript throw and error number



Hi All,

I noticed that when hosting a Jscript the error number is always
0x8004005 (E_FAIL), independently of which error code was supplied into
the Error object.
Consider the following code:

throw new Error(100, "Description");

When run in wscript exe it gives 0x8004005 as the error code,
while this snippet (in VBS):

Err.Raise 100, "Source", "Description"

gives me the expected 800A0064.

The same thing happens with manually implemented host -
OnScriptError(
/* [in] */ IActiveScriptError *pscripterror)
{
EXCEPINFO ei; ZeroMemory(&ei, sizeof(ei));
pscripterror->GetExceptionInfo(&ei);
Here - E_FAIL is returned in the scode part of the ei in case of
JScript, while for VBScript everything is fine.

Could anyone explain me how to thorw an erro in jScript in order to get
the intended error code, not E_FAIL?
Thanks in advance.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666