I think you can do something like this (although I've never tried it):
try {
artist = Artist.getArtist(cocoon.request.artID);
} catch(e) {
if (e instanceof TypeError) {
// do something
} else {
// do something for all other exceptions
}
}
Hope this helps.
- Brent
On Mon, 01 Nov 2004 16:09:09 +0100, Martin Rusnak <[EMAIL PROTECTED]> wrote:
> But in this example all exceptions are caught. Instead I want to catch and handle
> only exception of specific class and I want all other exceptions to be handled
> by the default handler.
>
>
>
> beyaNet wrote:
> > Martin,
> > in a word, YES!
> >
> > importClass(Packages.test.Artist);
> >
> > var artist;
> > var error_msg;
> >
> > function artistDetails() {
> >
> > try {
> > artist = Artist.getArtist(cocoon.request.artID);
> >
> > }catch(e) {
> > error_msg = e.toString();
> > }
> >
> > hope that helps ;-)
> >
> >
> > Andrew
> >
> > On 1 Nov 2004, at 14:28, Martin Rusnak wrote:
> >
> >> Hello all,
> >> Is it possible to catch and handle a specific exception class in flow
> >> script, like it
> >> is in Java? For example:
> >>
> >> try {
> >> registrator.register()
> >> } catch (RegistrationException e) {
> >> // do something
> >> }
> >>
> >> Martin
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]