I am using rhino.
How i can do error handing using rhino ?
Question example -
I had some method which is having some n number of input params, if one required param is undefine then i want to throw an error. For this I made a JS scriptable error object.
so how i can set this error object by using rhino error object ( if it does have) ?
please explain in detail.
I would be very thankful to you.
Thanks.
Rajat
send the code
Here is the code.
try{
alert(); // one argument is required for alert
}catch(e){
console.println( "e = " + e)
console.println( "e.name = " + e.name)
}
or just call
alert(); // one argument is required for alert
can we get the e object ?
what is the type of e object ?
Thanks
Rajat
________________________________
From: fel <felipe...@gmail.com>
To: dev-tech-js-...@lists.mozilla.org
Sent: Mon, November 9, 2009 8:14:23 PM
Subject: Re: Error handling - Help required !!
send the code
_______________________________________________
dev-tech-js-engine-rhino mailing list
dev-tech-js-...@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino
maybe, you can create error objects, by using throw(), but I don't
think using exceptions is a good way of flow control.
(but that's just me).
So I need the coressponding java object corresponding to JS e Object in following js script.
try{
alert(); // one argument is required for alert
}catch(e){
console.println( "e = " + e)
console.println( "e.name = " + e.name)
}
Hope you got answer of your question.
Please provide more detailed answer.
Thanks
Rajat
________________________________
From: Daryl Stultz <da...@6degrees.com>
To: Rhino JS User List <dev-tech-js-...@lists.mozilla.org>
Sent: Wed, December 16, 2009 6:42:32 PM
Subject: Re: Fw: Error handling - Help required !!
On Wed, Dec 16, 2009 at 1:09 AM, Rajat Gupta <innocent...@yahoo.com>wrote:
> Hi friends !
>
> This is a gentle remainder.
> I am still waiting for solving this please send me how should i proceed
> regarding this issue.
>
> Rajat, what is it you want to do that you haven't done already?
can we get the e object ?
>
What does that mean? You printed the e object, didn't you?
> what is the type of e object ?
>
>
JS objects don't really have a type in the was Java objects do. Again, what
is your goal?
--
Daryl Stultz
_____________________________________
6 Degrees Software and Consulting, Inc.
http://www.6degrees.com
mailto:da...@6degrees.com
> Actually I had a java object corresponding to each JS object.
> for example: X500Name java object and corresponding JS x500Name object.
>
> Ok, I understand that.
> So I need the coressponding java object corresponding to JS e Object in
> following js script.
>
> But I don't understand this. Can you give more details of why you need it
and how you will use it once you get it.