mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
Re-throwing UnsupportedOperationExceptions as Lua errors when thrown in callbacks (usually in OpenComponents' CC wrapper stuff).
This commit is contained in:
parent
0c96d38afb
commit
7d80fbcb60
@ -94,6 +94,10 @@ class NativeLuaArchitecture(val machine: api.machine.Machine) extends Architectu
|
||||
lua.pushNil()
|
||||
lua.pushString("i/o error")
|
||||
3
|
||||
case _: UnsupportedOperationException =>
|
||||
lua.pushBoolean(false)
|
||||
lua.pushString("unsupported operation")
|
||||
2
|
||||
case e: Throwable =>
|
||||
OpenComputers.log.log(Level.WARNING, "Unexpected error in Lua callback.", e)
|
||||
lua.pushBoolean(true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user