Mercurial Hosting > luan
diff src/luan/LuaState.java @ 42:786699c78837
implement try-catch
git-svn-id: https://luan-java.googlecode.com/svn/trunk@43 21e917c8-12df-6dd8-5cb6-c86387c605b9
author | fschmidt@gmail.com <fschmidt@gmail.com@21e917c8-12df-6dd8-5cb6-c86387c605b9> |
---|---|
date | Sun, 23 Dec 2012 06:36:56 +0000 |
parents | e3624b7cd603 |
children | 57054fa43189 |
line wrap: on
line diff
--- a/src/luan/LuaState.java Fri Dec 21 19:34:50 2012 +0000 +++ b/src/luan/LuaState.java Sun Dec 23 06:36:56 2012 +0000 @@ -65,6 +65,10 @@ return checkString( el, Lua.first( call(fn,el,"__tostring",obj) ) ); if( obj == null ) return "nil"; + if( obj instanceof LuaException ) { + LuaException le = (LuaException)obj; + return le.getMessage(); + } return obj.toString(); }