diff core/src/luan/modules/RpcLuan.java @ 646:cdc70de628b5

simplify LuanException
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 29 Mar 2016 19:58:39 -0600
parents b4f3dbe1c6e3
children b620b8e1010f
line wrap: on
line diff
--- a/core/src/luan/modules/RpcLuan.java	Tue Mar 29 18:09:51 2016 -0600
+++ b/core/src/luan/modules/RpcLuan.java	Tue Mar 29 19:58:39 2016 -0600
@@ -50,7 +50,7 @@
 				return rtn;
 			} else {
 				String msg = readString(in);
-				throw new LuanException(luan,msg);
+				throw new LuanException(msg);
 			}
 		} finally {
 			out.close();
@@ -75,7 +75,7 @@
 				}
 				LuanFunction fn = (LuanFunction)fns.rawGet(fnName);
 				if( fn == null )
-					throw new LuanException(luan, "function not found: " + fnName );
+					throw new LuanException( "function not found: " + fnName );
 				rtn = Luan.array(fn.call(luan,args));
 			} catch(LuanException e) {
 				writeBoolean(out,false);
@@ -121,7 +121,7 @@
 			writeString(out,s);
 		}
 		else
-			throw new LuanException(luan, "invalid type: " + obj.getClass() );
+			throw new LuanException( "invalid type: " + obj.getClass() );
 	}
 
 	static Object readObj(InputStream in,LuanState luan) throws IOException, LuanException {
@@ -142,7 +142,7 @@
 			LuanFunction fn = BasicLuan.load(luan,s,"rpc-reader",null,true);
 			return fn.call(luan);
 		default:
-			throw new LuanException(luan, "invalid type: " + type );
+			throw new LuanException( "invalid type: " + type );
 		}
 	}
 
@@ -208,7 +208,7 @@
 		if( obj instanceof LuanTable ) {
 			LuanTable tbl = (LuanTable)obj;
 			if( !set.add(tbl) ) {
-				throw new LuanException(luan, "circular reference in table" );
+				throw new LuanException( "circular reference in table" );
 			}
 			StringBuilder sb = new StringBuilder();
 			sb.append( "{" );
@@ -222,7 +222,7 @@
 			sb.append( "}" );
 			return sb.toString();
 		}
-		throw new LuanException(luan, "invalid type: " + obj.getClass() );
+		throw new LuanException( "invalid type: " + obj.getClass() );
 	}
 
 }