[Seaside] Improved HTML error handler

Sabine Manaa manaa.sabine at gmail.com
Wed Dec 21 08:41:31 UTC 2016


Hi Cyril,

I have an error Handler which resumes (if possible), shows a message to the
user and sends an email to me with the stack and further information.  If
you have questions, ask.

1) when registering the application: I attach  it to the RequestHandler:
"exceptionHandler: RKAHtmlErrorHandler"
2) the file out code of the error handler is below
3) an example of the mail in separate mail
4) also, when an error occurs (i catch them with an exception handler
overall), I create an instance of it
RKAHtmlErrorHandler
session: self requestContext session
stack: thisContext stack
exception: anException
ip: self ipAddressString
view: self class printString.

As you see in the timestamps, I use it for years now. Possibly some methods
are no longer used (especially the hard coded mail html code), I should do
a refactoring there:-). But always other topics. I hope it helps anyway
.

5) In my main layout view, I do this in the renderContentOn:
html document addLoadScript:
(html jQuery document onAjaxError: (self ajaxErrorHandler asFunction:
#('event' 'jqxhr' 'settings' 'exception')))

ajaxErrorHandler
^ ' if (jqxhr.status == 403) {
            alert("Aus Sicherheitsgründen wurde Ihre Sitzung beendet. Bitte
melden Sie sich neu an.");
            window.location.href =
settings.url.split("?")[0].replace("help","");
        } else {
if (jqxhr.status == 200) { } else {
alert("Entschuldigung, es ist ein Fehler aufgetreten. Bitte melden Sie sich
neu an und versuchen es erneut oder geben Sie uns eine Info über den
folgenden Fehler: " + exception +"jqxhr.status:"+jqxhr.status);
        }}'

Concerning the missing features for the v2, I was missing the following:

1) https://github.com/google/material-design-lite/issues/943
I fixed it by changing the overflow: to visible in mdl-card
2) date picker
I just started using
https://puranjayjain.github.io/md-date-time-picker/#documentation/time
3) same for time picker
so it seems that we will go online with v1. Too many changes in v2which
would take more time for us to go online

I hope the code helps
Regards
Sabine


2016-12-20 10:03 GMT+01:00 CyrilFerlicot [via Smalltalk] <
ml-node+s1294792n4927552h7 at n4.nabble.com>:

> Hi,
>
> I would like to know if someone already implemented an error handler
> that will render an error message instead of a component if there is an
> error during the rendering, but that will also proceed with the
> rendering of the page.
>
> I found the WAHtmlErrorHandler that show the message but it stop the
> rendering of the page. If I render a component A, B and C and B has an
> error I would like to see component A, an error message and component C.
> For now I can only see component A and an error message.
>
> Does someone already did this kind of thing? If not does someone has an
> idea of how to resume the rendering?
>
> Thank you
>
> --
> Cyril Ferlicot
>
> http://www.synectique.eu
>
> 2 rue Jacques Prévert 01,
> 59650 Villeneuve d'ascq France
>
>
> _______________________________________________
> seaside mailing list
> [hidden email] <http:///user/SendEmail.jtp?type=node&node=4927552&i=0>
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> *signature.asc* (817 bytes) Download Attachment
> <http://forum.world.st/attachment/4927552/0/signature.asc>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
> http://forum.world.st/Improved-HTML-error-handler-tp4927552.html
> To start a new topic under Seaside General, email
> ml-node+s1294792n86180h75 at n4.nabble.com
> To unsubscribe from Seaside, click here
> <http://forum.world.st/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=1310907&code=bWFuYWEuc2FiaW5lQGdtYWlsLmNvbXwxMzEwOTA3fC0xOTE3OTcxOTg5>
> .
> NAML
> <http://forum.world.st/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://forum.world.st/Improved-HTML-error-handler-tp4927552p4927734.html
Sent from the Seaside General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/seaside/attachments/20161221/a7af033f/attachment.html>


More information about the seaside mailing list