aboutsummaryrefslogtreecommitdiffstats
path: root/lib/condition.ml
diff options
context:
space:
mode:
authorEstevan Castilho <tevo@riajuu.net>2026-05-30 01:08:21 +0000
committerEstevan Castilho <tevo@riajuu.net>2026-05-30 01:08:21 +0000
commit2fa028193c76e6df949d535a37727cdab220a0dc (patch)
treeb7668d172f21f87e5db774adffb71df36abfe028 /lib/condition.ml
parentcd592d4c7e2e42425b65d587f2675c3ecec488d9 (diff)
downloadSakura-2fa028193c76e6df949d535a37727cdab220a0dc.tar.gz
Sakura-2fa028193c76e6df949d535a37727cdab220a0dc.zip
Do not include brackets around stringified condition properties
Diffstat (limited to 'lib/condition.ml')
-rw-r--r--lib/condition.ml5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/condition.ml b/lib/condition.ml
index 1b32d63..83ae9b8 100644
--- a/lib/condition.ml
+++ b/lib/condition.ml
@@ -11,6 +11,7 @@ end
let of_sexp (expr : Sexplib.Sexp.t) = new literal expr
let of_string (s : string) = new literal (Sexplib.Sexp.Atom s)
+let of_int (n : int) = of_string (Int.to_string n)
let of_list (f : 'a -> serializable) (l : 'a list) : serializable =
new literal (Sexplib.Sexp.List (List.map (fun e -> (f e)#as_sexp) l))
@@ -46,7 +47,9 @@ let to_string { name; message; properties; backtrace } =
let properties' =
properties
|> BatMap.to_seq
- |> BatSeq.to_string ~sep:"\n" (fun (k, v) -> "\t" ^ k ^ ": " ^ v#as_string)
+ |> BatSeq.to_string
+ ~first:"" ~last:"" ~sep:"\n"
+ (fun (k, v) -> "\t" ^ k ^ ": " ^ v#as_string)
in
let backtrace' = Printexc.raw_backtrace_to_string backtrace in
name ^ ": " ^ message ^ "\n" ^ properties' ^ "\n\nBacktrace:\n" ^ backtrace'