tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Denis Delangle (JIRA)" <j...@apache.org>
Subject [jira] Created: (TAP5-816) Add logs on reply script evaluation error
Date Tue, 18 Aug 2009 14:25:14 GMT
Add logs on reply script evaluation error
-----------------------------------------

                 Key: TAP5-816
                 URL: https://issues.apache.org/jira/browse/TAP5-816
             Project: Tapestry 5
          Issue Type: Improvement
          Components: tapestry-core
    Affects Versions: 5.1.0.0
            Reporter: Denis Delangle
            Priority: Minor


On ajax queries, if the evaluation of the script part of the reply fails, no message is shown
to the user. It is then tricky to solve issues. I only ask for logging of such errors.

Here is a diff for tapestry.js file adding a call to Tapestry.error. I don't know if exception
should be thrown back afterwards.

Index: tapestry.js
===================================================================
--- tapestry.js	(revision 805422)
+++ tapestry.js	(working copy)
@@ -307,7 +307,15 @@
                     // evaluating the reply.script
                     // and other final steps.
 
-                    if (reply.script) eval(reply.script);
+                    
+                    if (reply.script) {
+                    	try {
+                    		eval(reply.script);
+                    	} catch(e) {
+                    		//We catch any exception that can occur during script evaluation and
we log it
+                    		Tapestry.error(Tapestry.Messages.clientException + e);
+                    	}
+                    }
 
                     Tapestry.onDomLoadedCallback();
 


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message