Hi guys,

In addition, a doCatch(Throwable throwable) method was added on 
UniformResource, letting you handle those exceptions the way you need.

Best regards,
Jerome Louvel
--
Restlet ~ Founder and Lead developer ~ http://www.restlet.org
Noelios Technologies ~ Co-founder ~ http://www.noelios.com


-----Message d'origine-----
De : Laurent Rustuel [mailto:[email protected]] 
Envoyé : lundi 17 août 2009 16:52
À : [email protected]
Objet : Re: Exception handling issue - overriding get() vs using @Get

Hello,
Stoph a écrit :
> I was doing a search and I came across this thread:
> http://n2.nabble.com/ServerResource-conditional-mode-td2577651.html
> 
> My problem is that during development, RuntimeExceptions will sometimes get
> thrown. The behavior I am experiencing using annotations is that the
> exception is quietly caught and a 500 is given. I want to hook in my logger
> to display this exception as it was thrown to the method invoker, so the
> stack trace appears in my IDEA console.
You can extend StatusService class to handle how exception will be 
handled, see for this thread maybe 
http://restlet.markmail.org/message/ptesti33kkk5bksv?q=StatusService
Hope it will help you,
Laurent.

> 
> Stoph wrote:
>> 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:
>>
>> <pre>
>> @Get
>> public Representation represent(Variant variant) {
>>     return bar.represent();
>> }</pre>
>>
>> My issue: if "bar" is null, the NullPointerException was not showing up on
>> my IntelliJ console.
>>
>> This was fixed by changing it to:
>>
>> <pre>
>> @Override
>> public Representation get() {
>>     return bar.represent();
>> }</pre>
>>
>> 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.
>>
> 


-- 
Laurent Rustuel,
Alten contractor for Alcatel-Lucent, Brest

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

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

Reply via email to