From 52febf5d0f7fbb28dff7c8e91b8466fa7f19e7d8 Mon Sep 17 00:00:00 2001 From: LarryFrosty Date: Sun, 8 Sep 2024 01:24:46 +0800 Subject: [PATCH] help idk how error handlers work --- source/psychlua/HScript.hx | 4 ++-- source/states/PlayState.hx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/psychlua/HScript.hx b/source/psychlua/HScript.hx index 19b57db7..88ca5148 100644 --- a/source/psychlua/HScript.hx +++ b/source/psychlua/HScript.hx @@ -476,15 +476,15 @@ class HScript extends Iris { this.varsToBring = varsToBring; scriptCode = code; - parse(true); try { + parse(true); returnValue = execute(); return returnValue; } catch(e) { - PlayState.instance.addTextToDebug('ERROR (${this.origin}:${this.interp.posInfos()}): ${e}', FlxColor.RED); + PlayState.instance.addTextToDebug('ERROR (${this.origin}):${this.interp.posInfos().lineNumber} - ${e}', FlxColor.RED); } return null; } diff --git a/source/states/PlayState.hx b/source/states/PlayState.hx index f776b774..ec56d9e4 100644 --- a/source/states/PlayState.hx +++ b/source/states/PlayState.hx @@ -3282,7 +3282,7 @@ class PlayState extends MusicBeatState } catch(e:Dynamic) { - addTextToDebug('ERROR ON LOADING ($file) - $e', FlxColor.RED); + addTextToDebug('ERROR ON LOADING ($file):${this.interp.posInfos().lineNumber} - ${e}', FlxColor.RED); var newScript:HScript = cast (Iris.instances.get(file), HScript); if(newScript != null) newScript.destroy();