[Seaside] Handling errors - staging/production

John Toohey jt at parspro.com
Thu Jun 2 19:18:51 UTC 2011


I see the last exception is thrown because I'm using a
WAStreamResponse, and its already committed. At this stage I would
just like to redirect to an error page, and have the user log back in.
Is there any way to exit the chain, and perform a redirect?


On Thu, Jun 2, 2011 at 13:39, John Toohey <jt at parspro.com> wrote:
> Forgot to mention, that I'm using SS 3.0. I don't have those methods
> in WAExceptionHandler or its subclasses. I do have a #handleDefault,
> and I override that method to send the email, and then I do a
> redirect. However, I still get a WAIllegalStateException after that,
> which fires the debugger in the image.
>
> On Thu, Jun 2, 2011 at 13:10, Boris Popov, DeepCove Labs
> <boris at deepcovelabs.com> wrote:
>> John,
>>
>> You can configure the content rendered by your exception handler class using,
>>
>> #titleForException:
>> #updateHtmlRoot:forException:
>> #renderContentForException:on:
>>
>> Only WAWalkbackErrorHandler should be opening a debugger on the server, once you install your own handler which is subclassed from WAErrorHandler, it won't be doing it by default.
>>
>> -Boris
>>
>> -----Original Message-----
>> From: seaside-bounces at lists.squeakfoundation.org [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of John Toohey
>> Sent: 02 June 2011 13:06
>> To: Seaside - general discussion
>> Subject: Re: [Seaside] Handling errors - staging/production
>>
>> I have that with the Seaside class, but am not sure what to do beyond that (if anything). Should I send a redirect to an error page or handle the exception some other way. On my production servers, I often see socket timeout errors etc., and would like to just have these emailed/logged to disk, and not have the debugger come up in the image.
>>
>> On Thu, Jun 2, 2011 at 12:19, Boris Popov, DeepCove Labs <boris at deepcovelabs.com> wrote:
>>> John,
>>>
>>> We use our own mail handling system on top of clients provided by
>>> VisualWorks, so verbatim examples wouldn't be helpful to you, but here
>>> are some snippets,
>>>
>>> client := (SMTPClient new)
>>>                hostName: host;
>>>                user: (NetUser username: username password: password);
>>>                yourself.
>>> message := (MailMessage newTextPlain)
>>>                from: from;
>>>                replyTo: from;
>>>                to: to;
>>>                cc: cc;
>>>                bcc: bcc;
>>>                date: Timestamp now;
>>>                subject: subject;
>>>                text: body;
>>>                yourself.
>>> mimes do: [:each | message addAttachment: each].
>>> message prepareForTransport.
>>> client send: message.
>>>
>>> -Boris
>>>
>>> -----Original Message-----
>>> From: seaside-bounces at lists.squeakfoundation.org
>>> [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of John
>>> Toohey
>>> Sent: 02 June 2011 12:12
>>> To: Seaside - general discussion
>>> Subject: Re: [Seaside] Handling errors - staging/production
>>>
>>> Can you show the actual code that you are using? I've setup Postfix relaying to GMail on my laptop, and am using the WAEMailErrorHandler, but while I can get one message sent, I then usually get a WAIllegalStateException in the image. I'm not really sure if I am handling the exception correctly, but what I want to do it log/email it, and then have the app try to continue.
>>>
>>> Thanks.
>>>
>>>
>>> On Mon, May 30, 2011 at 13:46, Boris Popov, DeepCove Labs <boris at deepcovelabs.com> wrote:
>>>> We implement our own subclass of WAHtmlErrorHandler which logs the
>>>> exception and sends email notification before presenting an error
>>>> page to the browser,
>>>>
>>>> | app |
>>>> app := WAAdmin register: self asApplicationAt: 'online'.
>>>> app filter configuration at: #exceptionHandler put: WebErrorHandler.
>>>>
>>>> WebErrorHandler>>handleDefault: ex
>>>>  Manager
>>>>   notifyUnhandledException: ex
>>>>   in: self
>>>>   fatal: false.
>>>>  super handleDefault: ex.
>>>>
>>>> Hope this helps,
>>>>
>>>> -Boris
>>>>
>>>> -----Original Message-----
>>>> From: seaside-bounces at lists.squeakfoundation.org
>>>> [mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of
>>>> Francois Stephany
>>>> Sent: 30 May 2011 13:42
>>>> To: seaside at lists.squeakfoundation.org
>>>> Subject: [Seaside] Handling errors - staging/production
>>>>
>>>> What is the preferred way to handle errors on a production seaside application? Is there some kind of http://www.hoptoadapp.com/ to handle applications crashes/walkback?
>>>>
>>>> How do you typically do to handle errors?
>>>>
>>>> Cheers,
>>>> Francois
>>>>
>>>> _______________________________________________
>>>> seaside mailing list
>>>> seaside at lists.squeakfoundation.org
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>
>>>> _______________________________________________
>>>> seaside mailing list
>>>> seaside at lists.squeakfoundation.org
>>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> ~JT
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>> _______________________________________________
>>> seaside mailing list
>>> seaside at lists.squeakfoundation.org
>>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>>
>>>
>>
>>
>>
>> --
>> ~JT
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>> _______________________________________________
>> seaside mailing list
>> seaside at lists.squeakfoundation.org
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>>
>>
>
>
>
> --
> ~JT
>



-- 
~JT


More information about the seaside mailing list