Mercurial Hosting > luan
diff core/src/luan/LuanException.java @ 645:859c0dedc8b6
remove LuanSource
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Tue, 29 Mar 2016 18:09:51 -0600 |
parents | 60c549d43988 |
children | cdc70de628b5 |
line wrap: on
line diff
--- a/core/src/luan/LuanException.java Tue Mar 29 13:53:01 2016 -0600 +++ b/core/src/luan/LuanException.java Tue Mar 29 18:09:51 2016 -0600 @@ -16,6 +16,7 @@ table.rawPut( "java", this ); table.rawPut( "message", msg ); table.rawPut( "message_string", luan.toString(msg) ); +/* for( StackTraceElement ste : luan.stackTrace ) { LuanTable tbl = new LuanTable(); tbl.rawPut( "source", ste.call.source.name ); @@ -23,6 +24,7 @@ tbl.rawPut( "call_to", ste.fnName ); table.rawPut( table.rawLength() + 1, tbl ); } +*/ LuanTable metatable = new LuanTable(); table.setMetatable(metatable); try { @@ -59,6 +61,7 @@ } public static String __to_string(LuanTable table) { +/* StringBuilder buf = new StringBuilder(); Object msg = table.rawGet("message"); @@ -82,6 +85,11 @@ } return buf.toString(); +*/ + LuanException ex = (LuanException)table.rawGet("java"); + StringWriter sw = new StringWriter(); + ex.printStackTrace(new PrintWriter(sw)); + return sw.toString(); } }