comparison core/src/luan/LuanJavaFunction.java @ 578:60c549d43988

remove LuanState.exception()
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 14 Jul 2015 17:40:48 -0600
parents 7c3ad6db8ac3
children cdc70de628b5
comparison
equal deleted inserted replaced
577:d7a85fbe15f1 578:60c549d43988
92 Throwable cause = e.getCause(); 92 Throwable cause = e.getCause();
93 if( cause instanceof Error ) 93 if( cause instanceof Error )
94 throw (Error)cause; 94 throw (Error)cause;
95 if( cause instanceof LuanException ) 95 if( cause instanceof LuanException )
96 throw (LuanException)cause; 96 throw (LuanException)cause;
97 throw luan.exception(cause); 97 throw new LuanException(luan,cause);
98 } catch(InstantiationException e) { 98 } catch(InstantiationException e) {
99 throw new RuntimeException(e); 99 throw new RuntimeException(e);
100 } 100 }
101 return rtnConverter.convert(rtn); 101 return rtnConverter.convert(rtn);
102 } 102 }
129 expected = fixType(paramType.getComponentType().getSimpleName())+"..."; 129 expected = fixType(paramType.getComponentType().getSimpleName())+"...";
130 else 130 else
131 expected = fixType(paramType.getSimpleName()); 131 expected = fixType(paramType.getSimpleName());
132 if( arg==null ) { 132 if( arg==null ) {
133 if( paramType.isPrimitive() ) 133 if( paramType.isPrimitive() )
134 throw luan.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)"); 134 throw new LuanException(luan,"bad argument #"+(i+1-start)+" ("+expected+" expected, got nil)");
135 } else { 135 } else {
136 String got = fixType(arg.getClass().getSimpleName()); 136 String got = fixType(arg.getClass().getSimpleName());
137 throw luan.exception("bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")"); 137 throw new LuanException(luan,"bad argument #"+(i+1-start)+" ("+expected+" expected, got "+got+")");
138 } 138 }
139 } 139 }
140 } 140 }
141 } 141 }
142 142