@Override
public DumpData toDumpData(PageContext pageContext, int maxlevel, DumpProperties dp) {
//FFFFCF
DumpTable htmlBox = new DumpTable("exception","#ff9900","#FFCC00","#000000");
htmlBox.setTitle("Railo ["+Info.getVersionAsString()+"] - Error ("+StringUtil.ucFirst(getTypeAsString())+")");
// Message
htmlBox.appendRow(1,new SimpleDumpData("Message"),new SimpleDumpData(getMessage()));
// Detail
String detail=getDetail();
if(!StringUtil.isEmpty(detail,true))
htmlBox.appendRow(1,new SimpleDumpData("Detail"),new SimpleDumpData(detail));
// additional
Iterator<Key> it = additional.keyIterator();
Collection.Key k;
while(it.hasNext()) {
k=it.next();
htmlBox.appendRow(1,new SimpleDumpData(k.getString()),new SimpleDumpData(additional.get(k,"").toString()));
}
Array tagContext = getTagContext(pageContext.getConfig());
// Context MUSTMUST
if(tagContext.size()>0) {
//Collection.Key[] keys=tagContext.keys();
Iterator<Object> vit = tagContext.valueIterator();
//Entry<Key, Object> te;
DumpTable context=new DumpTable("#ff9900","#FFCC00","#000000");
//context.setTitle("The Error Occurred in");
//context.appendRow(0,new SimpleDumpData("The Error Occurred in"));
context.appendRow(7,
new SimpleDumpData(""),
new SimpleDumpData("template"),
new SimpleDumpData("line"));
try {
boolean first=true;
while(vit.hasNext()) {
Struct struct=(Struct)vit.next();
context.appendRow(1,
new SimpleDumpData(first?"called from ":"occurred in"),
new SimpleDumpData(struct.get(KeyConstants._template,"")+""),
new SimpleDumpData(Caster.toString(struct.get(KeyConstants._line,null))));
first=false;
}
htmlBox.appendRow(1,new SimpleDumpData("Context"),context);
// Code
String strCode=((Struct)tagContext.get(1,null)).get(KeyConstants._codePrintPlain,"").toString();
String[] arrCode = ListUtil.listToStringArray(strCode, '\n');
arrCode=ListUtil.trim(arrCode);
DumpTable code=new DumpTable("#ff9900","#FFCC00","#000000");
for(int i=0;i<arrCode.length;i++) {
code.appendRow(i==2?1:0,new SimpleDumpData(arrCode[i]));
}
htmlBox.appendRow(1,new SimpleDumpData("Code"),code);
}
catch (PageException e) {}
}
// Java Stacktrace
String strST=getStackTraceAsString();
String[] arrST = ListUtil.listToStringArray(strST, '\n');
arrST=ListUtil.trim(arrST);
DumpTable st=new DumpTable("#ff9900","#FFCC00","#000000");
for(int i=0;i<arrST.length;i++) {
st.appendRow(i==0?1:0,new SimpleDumpData(arrST[i]));
}
htmlBox.appendRow(1,new SimpleDumpData("Java Stacktrace"),st);
return htmlBox;
}