users@jersey.java.net

[Jersey] ExceptionMapper does not catch java.lang.Error

From: Jordan Blay <be.special_at_gmail.com>
Date: Tue, 25 Oct 2011 01:40:17 -0700 (PDT)

Hi!

I defined 2 classes that implement exceptionmapper.

The first one:

public class JsonExceptionMapper implements
ExceptionMapper<IndexOutOfBoundsException>

The second one:

public class ErrorExceptionMapper implements ExceptionMapper<Error>

The second one is to catch the error from here:

java.lang.Error: Error: could not match input
        at
com.sun.jersey.json.impl.reader.JsonLexer.zzScanError(JsonLexer.java:491)
        at com.sun.jersey.json.impl.reader.JsonLexer.yylex(JsonLexer.java:736)
        at
com.sun.jersey.json.impl.reader.JsonXmlStreamReader.nextToken(JsonXmlStreamReader.java:160)

However it doesn't catch it! only the first one works if there is
IndexOutOfBound exception!

Is it a bug?


--
View this message in context: http://jersey.576304.n2.nabble.com/ExceptionMapper-does-not-catch-java-lang-Error-tp6928025p6928025.html
Sent from the Jersey mailing list archive at Nabble.com.