Hierarchy of WAHtmlErrorHandlers

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Hierarchy of WAHtmlErrorHandlers

jtuchel

Dear Seasiders


I'd like to register a special HTM Error Handler for some Exceptions and one for all others.

I've seen there is a class Method #exceptionSelector in WAErrorHandler, where you can define the Exceptions that the handler wants to handle.
Of course things are not so easy, because I want one handler for all Errors and one for my special exception type, which, of course, is a subtype of Error.

Ho do I either

  • Specify an order in which the handlers are tested whether they handle: an exception? or
  • Specifiy an ExceptionSet that includes Error and all its children, but not my special type?

Any ideas?


Joachim

-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          [hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy of WAHtmlErrorHandlers

jtuchel
Oh, and I forgot one special important question whcih is a prerequisite for the other two:

Am I right in assuming that you can register multiple ErrorHandlers in a Seaside App?

Joachim



Am 17.07.17 um 14:50 schrieb [hidden email]:

Dear Seasiders


I'd like to register a special HTM Error Handler for some Exceptions and one for all others.

I've seen there is a class Method #exceptionSelector in WAErrorHandler, where you can define the Exceptions that the handler wants to handle.
Of course things are not so easy, because I want one handler for all Errors and one for my special exception type, which, of course, is a subtype of Error.

Ho do I either

  • Specify an order in which the handlers are tested whether they handle: an exception? or
  • Specifiy an ExceptionSet that includes Error and all its children, but not my special type?

Any ideas?


Joachim

-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          [hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1



_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


-- 
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          [hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy of WAHtmlErrorHandlers

Philippe Marschall
In reply to this post by jtuchel
On Mon, Jul 17, 2017 at 2:50 PM, [hidden email]
<[hidden email]> wrote:

> Dear Seasiders
>
>
> I'd like to register a special HTM Error Handler for some Exceptions and one
> for all others.
>
> I've seen there is a class Method #exceptionSelector in WAErrorHandler,
> where you can define the Exceptions that the handler wants to handle.
> Of course things are not so easy, because I want one handler for all Errors
> and one for my special exception type, which, of course, is a subtype of
> Error.
>
> Ho do I either

I would try the following, add to two WAExceptionFilters
- the first handles all errors and has an HTML error handler
- the second handles your specific exception type and has an error
handler that does your thing

If you look at the source of WAExceptionFiler >> #handleFiltered: and
WAExceptionHandler >> #handleExceptionsDuring: you'll end up two two
nested #on:do: blocks which is probably what you want.

Cheers
Philippe
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy of WAHtmlErrorHandlers

jtuchel
Hi Philippe,

You mean register a general one first and the special one second?

Joachim



Am 17.07.17 um 15:55 schrieb Philippe Marschall:

> On Mon, Jul 17, 2017 at 2:50 PM, [hidden email]
> <[hidden email]> wrote:
>> Dear Seasiders
>>
>>
>> I'd like to register a special HTM Error Handler for some Exceptions and one
>> for all others.
>>
>> I've seen there is a class Method #exceptionSelector in WAErrorHandler,
>> where you can define the Exceptions that the handler wants to handle.
>> Of course things are not so easy, because I want one handler for all Errors
>> and one for my special exception type, which, of course, is a subtype of
>> Error.
>>
>> Ho do I either
> I would try the following, add to two WAExceptionFilters
> - the first handles all errors and has an HTML error handler
> - the second handles your specific exception type and has an error
> handler that does your thing
>
> If you look at the source of WAExceptionFiler >> #handleFiltered: and
> WAExceptionHandler >> #handleExceptionsDuring: you'll end up two two
> nested #on:do: blocks which is probably what you want.
>
> Cheers
> Philippe
> _______________________________________________
> seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


--
-----------------------------------------------------------------------
Objektfabrik Joachim Tuchel          mailto:[hidden email]
Fliederweg 1                         http://www.objektfabrik.de
D-71640 Ludwigsburg                  http://joachimtuchel.wordpress.com
Telefon: +49 7141 56 10 86 0         Fax: +49 7141 56 10 86 1

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: Hierarchy of WAHtmlErrorHandlers

Philippe Marschall
On Mon, Jul 17, 2017 at 4:31 PM, [hidden email]
<[hidden email]> wrote:
> Hi Philippe,
>
> You mean register a general one first and the special one second?

Exactly
_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside