RE: Aborting request in Filter

2008-01-13 Thread Jerome Louvel
@restlet.tigris.org Objet : Re: Aborting request in Filter By the way, in the doHandle() method, if there isn't a next Restlet, the method sets the response to CLIENT_ERROR_NOT_FOUND. Shouldn't that be SERVER_ERROR_INTERNAL because the programmer goofed by not setting a next Restlet? - Paul

RE: Aborting request in Filter

2008-01-13 Thread Jerome Louvel
: Aborting request in Filter Hi Stephan, I agree, using enums here makes sense. Best regards, Jerome 2008/1/11, Stephan Koops [EMAIL PROTECTED] : What about using the enum instead of ints for the result? They are founded for this feature. ints can be directly compared

Re: Aborting request in Filter

2008-01-13 Thread Paul J. Lucas
Sorry for not commenting earlier, but Anyway, in thinking about this more, I don't think a filter should have any knowledge of its next filter. When a request is received, the engine should have a list of filters, i.e., the list itself should be external to all the filters. So,

Re: Aborting request in Filter

2008-01-11 Thread Stephan Koops
What about using the enum instead of ints for the result? They are founded for this feature. ints can be directly compared ( if(result = SKIP) or something like that). I don't know if it is possible for enums. Stephan Jerome Louvel schrieb: Instead, we could become more precise and return an

Re: Aborting request in Filter

2008-01-11 Thread Jerome Louvel
Hi Stephan, I agree, using enums here makes sense. Best regards, Jerome 2008/1/11, Stephan Koops [EMAIL PROTECTED]: What about using the enum instead of ints for the result? They are founded for this feature. ints can be directly compared ( if(result = SKIP) or something like that). I

Re: Aborting request in Filter

2008-01-10 Thread Paul J. Lucas
Well, if you want to post-process a request in error, you need to distinguish that case from the case where you don't want to post- process in error. Another problem is that the current doHandle() calls next.handle() and that doesn't return a boolean to indicate whether to do post-

Re: Aborting request in Filter

2008-01-10 Thread Rob Heittman
Jerome, What's the advantage of Filter.handle being final? - R

Re: Aborting request in Filter

2008-01-10 Thread Jerome Louvel
Hi Paul, Well, if you want to post-process a request in error, you need to distinguish that case from the case where you don't want to post- process in error. Another problem is that the current doHandle() calls next.handle() and that doesn't return a boolean to indicate whether to do post-

Re: Aborting request in Filter

2008-01-10 Thread Paul J. Lucas
By the way, in the doHandle() method, if there isn't a next Restlet, the method sets the response to CLIENT_ERROR_NOT_FOUND. Shouldn't that be SERVER_ERROR_INTERNAL because the programmer goofed by not setting a next Restlet? - Paul

Aborting request in Filter

2008-01-09 Thread Paul J. Lucas
If I write my own filter and use its beforeHandler(), I would like, upon some catastrophe, to abort the entire request and return some client error code. Unfortunately, it doesn't appear that the API for Filter allows aborting a request. True? This is another good case for using