truncate error messages when asking to continue

This commit is contained in:
2024-09-25 16:32:09 -05:00
parent e082ecf184
commit dd9e502696

View File

@@ -140,15 +140,18 @@
(preload
(set onError ->[e quit cc] {
(when ccAllErrors (cc)(return))
(director.chooseString
"Error ${e}. Continue?"
["Yes" "Yes to all" "Quit"]
->choice
(case choice
("Yes" (cc))
("Yes to all" (set ccAllErrors true)(cc))
("No" (quit))
(never otherwise)))
(let [&mut errorString "${e}"]
(when (> errorString.length 80)
(set errorString "$(errorString.substr 0 77)..."))
(director.chooseString
"Error ${errorString}. Continue?"
["Yes" "Yes to all" "Quit"]
->choice
(case choice
("Yes" (cc))
("Yes to all" (set ccAllErrors true)(cc))
("No" (quit))
(never otherwise))))
}))
// Prepare the interpreter for this movie's cached instructions