|
Post by Plutonus on Jan 20, 2017 16:24:03 GMT
Hey. I was just curious as to whether you can bypass AnkuLua's error handling or not.
status = xpcall(rpg, errorHandler)
function errorHandler() dialogInit() addTextView("ERROR - "..status) dialogShow("Fatal Error") end
function rpg() --stuff end If an error is present, AnkuLua presents me with it and ends my script, but I want to be able to except some errors so that my script can continue, for debugging purposes, I'll also need the error in a string, to toast it or create a console/log.
Thanks!
|
|
|
Post by vampiredbr9 on Jan 28, 2017 1:01:13 GMT
Hey. I was just curious as to whether you can bypass AnkuLua's error handling or not. status = xpcall(rpg, errorHandler)
function errorHandler() dialogInit() addTextView("ERROR - "..status) dialogShow("Fatal Error") end
function rpg() --stuff end If an error is present, AnkuLua presents me with it and ends my script, but I want to be able to except some errors so that my script can continue, for debugging purposes, I'll also need the error in a string, to toast it or create a console/log. Thanks! Example: Function battle() Click("test.png") --Badly coded on purpose, no test.png on screen, so returns error End if not(pcall(battle)) then Toast("error occured- ignoring") --If an error occured during battle function end Read more: ankulua.boards.net/user/2729/recent?page=2#ixzz4X0uhVSJ8
|
|
|
Post by vampiredbr9 on Jan 28, 2017 1:03:41 GMT
Hey. I was just curious as to whether you can bypass AnkuLua's error handling or not. status = xpcall(rpg, errorHandler)
function errorHandler() dialogInit() addTextView("ERROR - "..status) dialogShow("Fatal Error") end
function rpg() --stuff end If an error is present, AnkuLua presents me with it and ends my script, but I want to be able to except some errors so that my script can continue, for debugging purposes, I'll also need the error in a string, to toast it or create a console/log. Thanks! Research the Lua function pcall. There is no documentation on the ankulua website, but it works with it
|
|