aboutsummaryrefslogtreecommitdiff
path: root/src/mayu.gleam
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-05-27 09:57:05 +0000
committerFuwn <[email protected]>2026-05-27 10:12:41 +0000
commit5788c408b7e8afe35926cf62daefa3d45777a67c (patch)
treefe2130df6fffa5976e1e2b4ffd9bbe192e3e1df8 /src/mayu.gleam
parentrefactor: Fold images, extract pad_digits, rename xml binding (diff)
downloadmayu-5788c408b7e8afe35926cf62daefa3d45777a67c.tar.xz
mayu-5788c408b7e8afe35926cf62daefa3d45777a67c.zip
fix: Reject out-of-range digits and surface data directory errors
Diffstat (limited to 'src/mayu.gleam')
-rw-r--r--src/mayu.gleam11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mayu.gleam b/src/mayu.gleam
index 0d9fcf9..edb912d 100644
--- a/src/mayu.gleam
+++ b/src/mayu.gleam
@@ -12,7 +12,16 @@ import wisp
pub fn main() {
wisp.configure_logger()
- let _ = simplifile.create_directory("./data")
+ case simplifile.create_directory("./data") {
+ Ok(_) | Error(simplifile.Eexist) -> Nil
+ Error(error) -> {
+ wisp.log_error(
+ "Failed to create ./data directory: "
+ <> simplifile.describe_error(error),
+ )
+ panic as "cannot create data directory"
+ }
+ }
let image_cache = cache.load_themes()
let version_tag = case envoy.get("MAYU_VERSION") {
Ok(version) -> "(v" <> version <> ")"