Catching exceptions

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

Catching exceptions

jtuchel
Hi,

I have registered a subclass of WAHtmlErrorHandler with my Application using

myApp := WAAdmin register:..asApplicationAt:....
myApp exceptionHandler: MyExceptionHandlerClass.

And it does show its error page sometimes, but often an Exception thrown in an ActionCallback simply pops up a debugger in the development image and silently exits a runtime image.

You can sure imagine that this is not my intended behaviour.

In the walkback I can clearly see that an exception gets thrown and handled as usual, My HTML exception handler is never sent a message to.

Any ideas?

I am using Seaside 3.06 on VA Smalltalk 8.5.2.

Joachim
Reply | Threaded
Open this post in threaded view
|

Re: Catching exceptions

NorbertHartl
Hi Joachim,

Am 07.01.2013 um 10:22 schrieb jtuchel <[hidden email]>:

> Hi,
>
> I have registered a subclass of WAHtmlErrorHandler with my Application using
>
> myApp := WAAdmin register:..asApplicationAt:....
> myApp exceptionHandler: MyExceptionHandlerClass.
>
> And it does show its error page sometimes, but often an Exception thrown in
> an ActionCallback simply pops up a debugger in the development image and
> silently exits a runtime image.
>
> You can sure imagine that this is not my intended behaviour.
>
> In the walkback I can clearly see that an exception gets thrown and handled
> as usual, My HTML exception handler is never sent a message to.
>
> Any ideas?
>
> I am using Seaside 3.06 on VA Smalltalk 8.5.2.
>
did you add an WAExceptionFilter (myApp addFilter: WAExceptionFilter new)? This class prevents exceptions to be unhandled. The exception filter is configurable for the kind of exception handling you want. It can be walkback handler, email handler, …

Norbert

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

Re: Catching exceptions

jtuchel
Hi Norbert,

thanks for answering.

In fact, what you describe is what WAApplication>>#exceptionHandler: does:

exceptionHandler: anExceptionHandlerClass
| theFilter |
theFilter := self filters
detect: [ :ea | ea isExceptionFilter ]
ifNone: [ self addFilter: WAExceptionFilter new ].

theFilter configuration at: #exceptionHandler put: anExceptionHandlerClass

So, yes, I did ;-)

I have another suspicion: VA Smalltalk has once had (and still supports
it) an instance based exception system, and maybe the exceptions that do
not get caught are such exception based ones... I'll investigate this a
little further and let you know what I find out.

Joachim


Am 07.01.13 12:15, schrieb Norbert Hartl:

> Hi Joachim,
>
> Am 07.01.2013 um 10:22 schrieb jtuchel <[hidden email]>:
>
>> Hi,
>>
>> I have registered a subclass of WAHtmlErrorHandler with my Application using
>>
>> myApp := WAAdmin register:..asApplicationAt:....
>> myApp exceptionHandler: MyExceptionHandlerClass.
>>
>> And it does show its error page sometimes, but often an Exception thrown in
>> an ActionCallback simply pops up a debugger in the development image and
>> silently exits a runtime image.
>>
>> You can sure imagine that this is not my intended behaviour.
>>
>> In the walkback I can clearly see that an exception gets thrown and handled
>> as usual, My HTML exception handler is never sent a message to.
>>
>> Any ideas?
>>
>> I am using Seaside 3.06 on VA Smalltalk 8.5.2.
>>
> did you add an WAExceptionFilter (myApp addFilter: WAExceptionFilter new)? This class prevents exceptions to be unhandled. The exception filter is configurable for the kind of exception handling you want. It can be walkback handler, email handler, …
>
> Norbert
>
> _______________________________________________
> 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

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Catching exceptions

Karsten Kusche

It could also be that the exception is raise when the exception handler is not in place. The handler is added through a filter and if the exception happens before or after that filter is applied, you see the debugger.

Kind Regards
Karsten



-- 
Karsten Kusche - Dipl. Inf. - [hidden email]
Georg Heeg eK - Köthen
Handelsregister: Amtsgericht Dortmund A 12812 

Am Montag, 7. Januar 2013 um 13:43 schrieb Joachim Tuchel:

Hi Norbert,

thanks for answering.

In fact, what you describe is what WAApplication>>#exceptionHandler: does:

exceptionHandler: anExceptionHandlerClass
| theFilter |
theFilter := self filters
detect: [ :ea | ea isExceptionFilter ]
ifNone: [ self addFilter: WAExceptionFilter new ].

theFilter configuration at: #exceptionHandler put: anExceptionHandlerClass

So, yes, I did ;-)

I have another suspicion: VA Smalltalk has once had (and still supports
it) an instance based exception system, and maybe the exceptions that do
not get caught are such exception based ones... I'll investigate this a
little further and let you know what I find out.

Joachim


Am 07.01.13 12:15, schrieb Norbert Hartl:
Hi Joachim,

Am 07.01.2013 um 10:22 schrieb jtuchel <[hidden email]>:

Hi,

I have registered a subclass of WAHtmlErrorHandler with my Application using

myApp := WAAdmin register:..asApplicationAt:....
myApp exceptionHandler: MyExceptionHandlerClass.

And it does show its error page sometimes, but often an Exception thrown in
an ActionCallback simply pops up a debugger in the development image and
silently exits a runtime image.

You can sure imagine that this is not my intended behaviour.

In the walkback I can clearly see that an exception gets thrown and handled
as usual, My HTML exception handler is never sent a message to.

Any ideas?

I am using Seaside 3.06 on VA Smalltalk 8.5.2.
did you add an WAExceptionFilter (myApp addFilter: WAExceptionFilter new)? This class prevents exceptions to be unhandled. The exception filter is configurable for the kind of exception handling you want. It can be walkback handler, email handler, …

Norbert

_______________________________________________
seaside mailing list

--
-- 
----------------------------------------------------------------------- 
Objektfabrik Joachim Tuchel [hidden email] 
Fliederweg 1 http://www.objektfabrik.de
Telefon: +49 7141 56 10 86 0 Fax: +49 7141 56 10 86 1
_______________________________________________
seaside mailing list

Anhänge:
- smime.p7s


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

Re: Catching exceptions

jtuchel
Hi Karsten,

in the meantime, I found the reason, and it is as I suspected:

Some places in VA Smalltalk still use instance based exceptions and
these will not be caught and therefor not be forwarded to a
WAExceptionHandler.
In VA Smalltalk Object>>#error: signals an instance based exception. So
if somewhere in a callback method you use error:, you fire an exception
that doesn't get caught by the Seaside machinery.

Instantiations discourages the use of instance based exceptions and is
removing them from VAST step by step, but it's not done yet. And they
cannot force users to change their code immediately, so I need to find a
way to extend Seaside to catch instance based exveptions as well as
class based ones.

Does anyone have a quick pointer where to look? I'll dive right into the
browsers now and look myself... ;-)

Joachim



Am 07.01.13 13:49, schrieb Karsten Kusche:

>
> It could also be that the exception is raise when the exception
> handler is not in place. The handler is added through a filter and if
> the exception happens before or after that filter is applied, you see
> the debugger.
>
> Kind Regards
> Karsten
>
>
>
> --
> Karsten Kusche - Dipl. Inf. - [hidden email]
> Georg Heeg eK - Köthen
> Handelsregister: Amtsgericht Dortmund A 12812
>
> Am Montag, 7. Januar 2013 um 13:43 schrieb Joachim Tuchel:
>
>> Hi Norbert,
>>
>> thanks for answering.
>>
>> In fact, what you describe is what WAApplication>>#exceptionHandler:
>> does:
>>
>> exceptionHandler: anExceptionHandlerClass
>> | theFilter |
>> theFilter := self filters
>> detect: [ :ea | ea isExceptionFilter ]
>> ifNone: [ self addFilter: WAExceptionFilter new ].
>>
>> theFilter configuration at: #exceptionHandler put:
>> anExceptionHandlerClass
>>
>> So, yes, I did ;-)
>>
>> I have another suspicion: VA Smalltalk has once had (and still supports
>> it) an instance based exception system, and maybe the exceptions that do
>> not get caught are such exception based ones... I'll investigate this a
>> little further and let you know what I find out.
>>
>> Joachim
>>
>>
>> Am 07.01.13 12:15, schrieb Norbert Hartl:
>>> Hi Joachim,
>>>
>>> Am 07.01.2013 um 10:22 schrieb jtuchel <[hidden email]
>>> <mailto:[hidden email]>>:
>>>
>>>> Hi,
>>>>
>>>> I have registered a subclass of WAHtmlErrorHandler with my
>>>> Application using
>>>>
>>>> myApp := WAAdmin register:..asApplicationAt:....
>>>> myApp exceptionHandler: MyExceptionHandlerClass.
>>>>
>>>> And it does show its error page sometimes, but often an Exception
>>>> thrown in
>>>> an ActionCallback simply pops up a debugger in the development
>>>> image and
>>>> silently exits a runtime image.
>>>>
>>>> You can sure imagine that this is not my intended behaviour.
>>>>
>>>> In the walkback I can clearly see that an exception gets thrown and
>>>> handled
>>>> as usual, My HTML exception handler is never sent a message to.
>>>>
>>>> Any ideas?
>>>>
>>>> I am using Seaside 3.06 on VA Smalltalk 8.5.2.
>>> did you add an WAExceptionFilter (myApp addFilter: WAExceptionFilter
>>> new)? This class prevents exceptions to be unhandled. The exception
>>> filter is configurable for the kind of exception handling you want.
>>> It can be walkback handler, email handler, …
>>>
>>> Norbert
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> [hidden email]
>>> <mailto:[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]
>> <mailto:[hidden email]>
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>> Anhänge:
>> - smime.p7s
>
>
>
> _______________________________________________
> 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

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Catching exceptions

jtuchel
Found the place:

WAExceptionHandler>>#handleFiltered:

Thanks for reading, helped me think ;-)

Joachim

Am 07.01.13 14:04, schrieb Joachim Tuchel:

> Hi Karsten,
>
> in the meantime, I found the reason, and it is as I suspected:
>
> Some places in VA Smalltalk still use instance based exceptions and
> these will not be caught and therefor not be forwarded to a
> WAExceptionHandler.
> In VA Smalltalk Object>>#error: signals an instance based exception.
> So if somewhere in a callback method you use error:, you fire an
> exception that doesn't get caught by the Seaside machinery.
>
> Instantiations discourages the use of instance based exceptions and is
> removing them from VAST step by step, but it's not done yet. And they
> cannot force users to change their code immediately, so I need to find
> a way to extend Seaside to catch instance based exveptions as well as
> class based ones.
>
> Does anyone have a quick pointer where to look? I'll dive right into
> the browsers now and look myself... ;-)
>
> Joachim
>
>
>
> Am 07.01.13 13:49, schrieb Karsten Kusche:
>>
>> It could also be that the exception is raise when the exception
>> handler is not in place. The handler is added through a filter and if
>> the exception happens before or after that filter is applied, you see
>> the debugger.
>>
>> Kind Regards
>> Karsten
>>
>>
>>
>> --
>> Karsten Kusche - Dipl. Inf. - [hidden email]
>> Georg Heeg eK - Köthen
>> Handelsregister: Amtsgericht Dortmund A 12812
>>
>> Am Montag, 7. Januar 2013 um 13:43 schrieb Joachim Tuchel:
>>
>>> Hi Norbert,
>>>
>>> thanks for answering.
>>>
>>> In fact, what you describe is what WAApplication>>#exceptionHandler:
>>> does:
>>>
>>> exceptionHandler: anExceptionHandlerClass
>>> | theFilter |
>>> theFilter := self filters
>>> detect: [ :ea | ea isExceptionFilter ]
>>> ifNone: [ self addFilter: WAExceptionFilter new ].
>>>
>>> theFilter configuration at: #exceptionHandler put:
>>> anExceptionHandlerClass
>>>
>>> So, yes, I did ;-)
>>>
>>> I have another suspicion: VA Smalltalk has once had (and still supports
>>> it) an instance based exception system, and maybe the exceptions
>>> that do
>>> not get caught are such exception based ones... I'll investigate this a
>>> little further and let you know what I find out.
>>>
>>> Joachim
>>>
>>>
>>> Am 07.01.13 12:15, schrieb Norbert Hartl:
>>>> Hi Joachim,
>>>>
>>>> Am 07.01.2013 um 10:22 schrieb jtuchel <[hidden email]
>>>> <mailto:[hidden email]>>:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have registered a subclass of WAHtmlErrorHandler with my
>>>>> Application using
>>>>>
>>>>> myApp := WAAdmin register:..asApplicationAt:....
>>>>> myApp exceptionHandler: MyExceptionHandlerClass.
>>>>>
>>>>> And it does show its error page sometimes, but often an Exception
>>>>> thrown in
>>>>> an ActionCallback simply pops up a debugger in the development
>>>>> image and
>>>>> silently exits a runtime image.
>>>>>
>>>>> You can sure imagine that this is not my intended behaviour.
>>>>>
>>>>> In the walkback I can clearly see that an exception gets thrown
>>>>> and handled
>>>>> as usual, My HTML exception handler is never sent a message to.
>>>>>
>>>>> Any ideas?
>>>>>
>>>>> I am using Seaside 3.06 on VA Smalltalk 8.5.2.
>>>> did you add an WAExceptionFilter (myApp addFilter:
>>>> WAExceptionFilter new)? This class prevents exceptions to be
>>>> unhandled. The exception filter is configurable for the kind of
>>>> exception handling you want. It can be walkback handler, email
>>>> handler, …
>>>>
>>>> Norbert
>>>>
>>>> _______________________________________________
>>>> seaside mailing list
>>>> [hidden email]
>>>> <mailto:[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]
>>> <mailto:[hidden email]>
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>> Anhänge:
>>> - smime.p7s
>>
>>
>>
>> _______________________________________________
>> seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
>
>
> _______________________________________________
> 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

smime.p7s (7K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Catching exceptions

Philippe Marschall
In reply to this post by jtuchel
On Mon, Jan 7, 2013 at 2:04 PM, Joachim Tuchel <[hidden email]> wrote:

> Hi Karsten,
>
> in the meantime, I found the reason, and it is as I suspected:
>
> Some places in VA Smalltalk still use instance based exceptions and these
> will not be caught and therefor not be forwarded to a WAExceptionHandler.
> In VA Smalltalk Object>>#error: signals an instance based exception. So if
> somewhere in a callback method you use error:, you fire an exception that
> doesn't get caught by the Seaside machinery.
>
> Instantiations discourages the use of instance based exceptions and is
> removing them from VAST step by step, but it's not done yet. And they cannot
> force users to change their code immediately, so I need to find a way to
> extend Seaside to catch instance based exveptions as well as class based
> ones.
>
> Does anyone have a quick pointer where to look? I'll dive right into the
> browsers now and look myself... ;-)

WAExceptionFilter >> #handleFiltered:

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