comparison src/luan/LuanException.java @ 1121:4cf541886663

check for too many arguments to java fns
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 11 Aug 2017 17:57:52 -0600
parents 6a7c6879158d
children e15be31cee92
comparison
equal deleted inserted replaced
1120:e8fc6712b468 1121:4cf541886663
49 ) ); 49 ) );
50 table.rawPut( "get_java_stack_trace_string", new LuanJavaFunction( 50 table.rawPut( "get_java_stack_trace_string", new LuanJavaFunction(
51 LuanException.class.getMethod( "getJavaStackTraceString" ), this 51 LuanException.class.getMethod( "getJavaStackTraceString" ), this
52 ) ); 52 ) );
53 metatable.rawPut( "__to_string", new LuanJavaFunction( 53 metatable.rawPut( "__to_string", new LuanJavaFunction(
54 LuanException.class.getMethod( "getFullMessage" ), this 54 LuanException.class.getMethod( "__to_string", LuanTable.class ), this
55 ) ); 55 ) );
56 } catch(NoSuchMethodException e) { 56 } catch(NoSuchMethodException e) {
57 throw new RuntimeException(e); 57 throw new RuntimeException(e);
58 } 58 }
59 } 59 }
60 return table; 60 return table;
61 } 61 }
62 62
63 public void throwThis() throws LuanException { 63 public void throwThis() throws LuanException {
64 throw this; 64 throw this;
65 }
66
67 public String __to_string(LuanTable ignore) {
68 return getFullMessage();
65 } 69 }
66 70
67 public String getFullMessage() { 71 public String getFullMessage() {
68 return getLuanStackTraceString(); 72 return getLuanStackTraceString();
69 // return getLuanStackTraceString()+"\n"+getJavaStackTraceString(); 73 // return getLuanStackTraceString()+"\n"+getJavaStackTraceString();