Hello all! I am here to report an issue I am having and see if the problem
lies with myself or with Restlet.

I have a class FooResource which extends ServerResource.

I originally had a method to handle the representation like this:


@Get
public Representation represent(Variant variant) {
    return bar.represent();
}


My issue: if "bar" is null, the NullPointerException was not showing up on
my IntelliJ console.

This was fixed by changing it to:


@Override
public Representation get() {
    return bar.represent();
}


Can anyone elaborate why I only see the exception in this last instance? My
guess is that it's because java reflection is throwing a
InvocationTargetException so Restlet handles this first case differently
than the second case.
-- 
View this message in context: 
http://n2.nabble.com/Exception-handling-issue---overriding-get%28%29-vs-using-%40Get-tp3435034p3435034.html
Sent from the Restlet Discuss mailing list archive at Nabble.com.

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2383095

Reply via email to