Skip to content

Commit

Permalink
change in error msg
Browse files Browse the repository at this point in the history
  • Loading branch information
thiago committed Aug 26, 2004
1 parent f8624af commit 1135fed
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/java/luajava/Console.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,26 @@ else if (res == LuaState.LUA_ERRERR.intValue())
{
int ret = L.doString(line);
if (ret != 0)
System.out.println("Invalid Input : " + line);
{
String str;
if (ret == LuaState.LUA_ERRRUN.intValue())
{
str = "Runtime error. ";
}
else if (ret == LuaState.LUA_ERRMEM.intValue())
{
str = "Memory allocation error. ";
}
else if (ret == LuaState.LUA_ERRERR.intValue())
{
str = "Error while running the error handler function. ";
}
else
{
str = "Lua Error code " + ret + ". ";
}
System.out.println(str + line);
}
System.out.print("> ");
}

Expand Down

0 comments on commit 1135fed

Please sign in to comment.