Catch Exception instead of Throwable for all but LuaThread run loop
This commit is contained in:
@@ -286,8 +286,8 @@ public class DebugLib extends VarArgFunction {
|
|||||||
} finally {
|
} finally {
|
||||||
ds.popInfo(n);
|
ds.popInfo(n);
|
||||||
}
|
}
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
t.printStackTrace();
|
e.printStackTrace();
|
||||||
} finally {
|
} finally {
|
||||||
inhook = false;
|
inhook = false;
|
||||||
}
|
}
|
||||||
@@ -302,7 +302,7 @@ public class DebugLib extends VarArgFunction {
|
|||||||
DebugInfo getDebugInfo() {
|
DebugInfo getDebugInfo() {
|
||||||
try {
|
try {
|
||||||
return debugInfo[debugCalls-1];
|
return debugInfo[debugCalls-1];
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
if ( debugCalls <= 0 )
|
if ( debugCalls <= 0 )
|
||||||
return debugInfo[debugCalls++] = new DebugInfo();
|
return debugInfo[debugCalls++] = new DebugInfo();
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
@@ -196,8 +196,8 @@ public class lua {
|
|||||||
}
|
}
|
||||||
Varargs scriptargs = (args!=null? setGlobalArg(args, firstarg): LuaValue.NONE);
|
Varargs scriptargs = (args!=null? setGlobalArg(args, firstarg): LuaValue.NONE);
|
||||||
c.invoke( scriptargs );
|
c.invoke( scriptargs );
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
t.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -206,8 +206,8 @@ public class lua2java {
|
|||||||
pw.close();
|
pw.close();
|
||||||
out.close();
|
out.close();
|
||||||
in.close();
|
in.close();
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
t.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -172,8 +172,8 @@ public class luac {
|
|||||||
DumpState.dump(chunk, out, stripdebug, numberformat, littleendian);
|
DumpState.dump(chunk, out, stripdebug, numberformat, littleendian);
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
t.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
} finally {
|
} finally {
|
||||||
script.close();
|
script.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,17 +228,17 @@ public class luajc {
|
|||||||
Object o = c.newInstance();
|
Object o = c.newInstance();
|
||||||
if ( verbose )
|
if ( verbose )
|
||||||
System.out.println(" loaded "+classname+" as "+o );
|
System.out.println(" loaded "+classname+" as "+o );
|
||||||
} catch ( Throwable th ) {
|
} catch ( Exception ex ) {
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
System.err.println(" failed to load "+classname+": "+th );
|
System.err.println(" failed to load "+classname+": "+ex );
|
||||||
System.err.flush();
|
System.err.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
System.err.println(" failed to load "+inf.srcfilename+": "+t );
|
System.err.println(" failed to load "+inf.srcfilename+": "+e );
|
||||||
t.printStackTrace( System.err );
|
e.printStackTrace( System.err );
|
||||||
System.err.flush();
|
System.err.flush();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -189,8 +189,8 @@ public class LuaScriptEngine implements ScriptEngine, Compilable {
|
|||||||
} finally {
|
} finally {
|
||||||
ris.close();
|
ris.close();
|
||||||
}
|
}
|
||||||
} catch ( Throwable t ) {
|
} catch ( Exception e ) {
|
||||||
throw new ScriptException("eval threw "+t.toString());
|
throw new ScriptException("eval threw "+e.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user