Improved HTML error handler

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

Improved HTML error handler

CyrilFerlicot
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://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Improved HTML error handler

Sabine Manaa
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:

I fixed it by changing the overflow: to visible in mdl-card
2) date picker
I just started using 
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] <[hidden email]>:
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://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (817 bytes) Download Attachment



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 [hidden email]
To unsubscribe from Seaside, click here.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Improved HTML error handler

Sabine Manaa
In reply to this post by CyrilFerlicot
fileout

2016-12-21 9:56 GMT+01:00 Sabine Manaa <[hidden email]>:
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:

I fixed it by changing the overflow: to visible in mdl-card
2) date picker
I just started using 
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] <[hidden email]>:
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://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (817 bytes) Download Attachment



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 [hidden email]
To unsubscribe from Seaside, click here.
NAML



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

Re: Improved HTML error handler

Sabine Manaa
sorry, wrong receiver!!!

2016-12-21 9:41 GMT+01:00 Sabine Manaa <[hidden email]>:
fileout

2016-12-21 9:56 GMT+01:00 Sabine Manaa <[hidden email]>:
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:

I fixed it by changing the overflow: to visible in mdl-card
2) date picker
I just started using 
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] <[hidden email]>:
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://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (817 bytes) Download Attachment



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 [hidden email]
To unsubscribe from Seaside, click here.
NAML



RKAHtmlErrorHandler.st (7K) Download Attachment


View this message in context: Re: Improved HTML error handler
Sent from the Seaside General mailing list archive at Nabble.com.

_______________________________________________
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
Reply | Threaded
Open this post in threaded view
|

Re: Improved HTML error handler

Sabine Manaa
wtf I have sent all the mails to the mailing list. I wanted to send it to Cyril because I also answered another question. But anyway, perhaps it is useful.
Regards
Sabine

2016-12-21 9:57 GMT+01:00 Sabine Manaa <[hidden email]>:
sorry, wrong receiver!!!

2016-12-21 9:41 GMT+01:00 Sabine Manaa <[hidden email]>:
fileout

2016-12-21 9:56 GMT+01:00 Sabine Manaa <[hidden email]>:
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:

I fixed it by changing the overflow: to visible in mdl-card
2) date picker
I just started using 
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] <[hidden email]>:
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://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

signature.asc (817 bytes) Download Attachment



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 [hidden email]
To unsubscribe from Seaside, click here.
NAML



RKAHtmlErrorHandler.st (7K) Download Attachment


View this message in context: Re: Improved HTML error handler
Sent from the Seaside General mailing list archive at Nabble.com.

_______________________________________________
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