From 99c64198c898eb33b7315dfd15a3832c65b8d772 Mon Sep 17 00:00:00 2001 From: Nat Quayle Nelson Date: Wed, 29 Oct 2025 19:03:55 -0500 Subject: [PATCH] hank-vscode show errors --- hank-vscode/haxe_libraries/hank.hxml | 7 +++---- hank-vscode/src/Main.kiss | 8 ++++++-- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/hank-vscode/haxe_libraries/hank.hxml b/hank-vscode/haxe_libraries/hank.hxml index 073185f..54b46e7 100644 --- a/hank-vscode/haxe_libraries/hank.hxml +++ b/hank-vscode/haxe_libraries/hank.hxml @@ -1,6 +1,5 @@ -# @install: lix --silent download "git:https://k7izh9.gitea.cloud/NQN/hank#a7bd12074c88b29a58d68eba720c657f6a267cc6" into hank/0.0.8/git/a7bd12074c88b29a58d68eba720c657f6a267cc6 -# @run: haxelib run-dir hank "${HAXE_LIBCACHE}/hank/0.0.8/git/a7bd12074c88b29a58d68eba720c657f6a267cc6" -lib hscript -lib utest --cp ${HAXE_LIBCACHE}/hank/0.0.8/git/a7bd12074c88b29a58d68eba720c657f6a267cc6/ --D hank=0.0.8 \ No newline at end of file +-cp /Users/nat/repos/hank +-D hank=0.0.8 +--macro Sys.println("haxe_libraries/hank.hxml:4: [Warning] Using dev version of library hank") \ No newline at end of file diff --git a/hank-vscode/src/Main.kiss b/hank-vscode/src/Main.kiss index 5d7cdb4..3d1c065 100644 --- a/hank-vscode/src/Main.kiss +++ b/hank-vscode/src/Main.kiss @@ -13,7 +13,9 @@ (localFunction elementFor [:Story story :Dynamic document] (let [:Dynamic d (document.createElement "div")] (loop - (case (story.nextFrame) + (case (try + (story.nextFrame) + (catch [e] (errorMessage "$e") Finished)) ((HasText t) (let [p (document.createElement "p")] (set p.innerHTML t) (d.appendChild p))) @@ -37,7 +39,9 @@ ->[document type data] (case type ("choose" - (story.choose data) + (try + (story.choose data) + (catch [e] (errorMessage "$e"))) (set document.body.innerHTML "") (document.body.appendChild (elementFor story document))) (never otherwise))))