incubator-xap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mtu...@apache.org
Subject svn commit: r419331 - /incubator/xap/trunk/src/xap/util/XapException.js
Date Wed, 05 Jul 2006 20:29:52 GMT
Author: mturyn
Date: Wed Jul  5 13:29:51 2006
New Revision: 419331

URL: http://svn.apache.org/viewvc?rev=419331&view=rev
Log:
Added a variation for exceptions without a toString

Modified:
    incubator/xap/trunk/src/xap/util/XapException.js

Modified: incubator/xap/trunk/src/xap/util/XapException.js
URL: http://svn.apache.org/viewvc/incubator/xap/trunk/src/xap/util/XapException.js?rev=419331&r1=419330&r2=419331&view=diff
==============================================================================
--- incubator/xap/trunk/src/xap/util/XapException.js (original)
+++ incubator/xap/trunk/src/xap/util/XapException.js Wed Jul  5 13:29:51 2006
@@ -113,16 +113,20 @@
 	}
 	
 	if (exception.getLocation && exception.getLocation()){
-		s+="Occured at:" + exception.getLocation() + "\n";
+		s+="Occurred at:" + exception.getLocation() + "\n";
 	}
 	
 	if (exception.getCause){
 		s+="Caused by:\n" + XapException.exceptionToString(exception.getCause());
 	}
 	
-	//last resort just use to string
-	if (s.length==0){
+	//next-to-last resort just use toString
+	if (s.length==0 && s.toString){
 		s = exception.toString();
+	}
+	// last resort: let JS sort it out:
+	if (s.length==0){
+		s = "" +exception ;
 	}
 	
 	return s;



Mime
View raw message