Revision: 1686 http://svn.sourceforge.net/vexi/?rev=1686&view=rev Author: mkpg2 Date: 2007-02-19 08:52:20 -0800 (Mon, 19 Feb 2007)
Log Message: ----------- Improve reporting of source errors/warnings. Modified Paths: -------------- core/trunk/org.vexi.core/src/org/vexi/core/TemplateBuilder.java Modified: core/trunk/org.vexi.core/src/org/vexi/core/TemplateBuilder.java =================================================================== --- core/trunk/org.vexi.core/src/org/vexi/core/TemplateBuilder.java 2007-02-17 16:25:43 UTC (rev 1685) +++ core/trunk/org.vexi.core/src/org/vexi/core/TemplateBuilder.java 2007-02-19 16:52:20 UTC (rev 1686) @@ -15,6 +15,7 @@ import org.ibex.js.Parser.GlobalsChecker; import org.ibex.util.Basket; import org.ibex.util.Log; +import org.ibex.util.SourceException; import org.ibex.util.Tree; import org.ibex.util.Vec; import org.ibex.util.XML; @@ -82,6 +83,8 @@ createStatic(); JS staticScope = t.new StaticScope(); if (staticScript != null) JSU.cloneWithNewGlobalScope(staticScript, staticScope).call(null, callempty); + }else{ + Log.uWarn(LOG_TYPE, "'" + sourceName + ".t' does not declare a template"); } } }catch(XML.Exn e){ @@ -166,8 +169,12 @@ // t.prev2 = (Template)t.vexi.resolveString(tagname, false).call(null, null, null, null, 9999); if(t.principal != null) throw new Error("FIXME: t.principal != null"); t.principal = ((Blessing)Vexi.resolveString(t.vexi,tagname, false)).getTemplate(); - if(t.principal == null) throw new Exception("" + tagname + " not found"); - } catch (Exception e) { + if(t.principal == null) throw new SourceException("" + tagname + " not found", sourceName, getLine()); + }catch(SourceException e){ + Log.uError(e.getMessageSig(), e.getWhere() + "\n- "+ e.getMessage()); + Log.debug(this, e); + } + catch (Exception e) { Log.uError(Template.class, e + " at " + this.sourceName + ", line " + this.getLine() + "."); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn