diff options
| author | Estevan Castilho <tevo@riajuu.net> | 2026-05-30 01:08:21 +0000 |
|---|---|---|
| committer | Estevan Castilho <tevo@riajuu.net> | 2026-05-30 01:08:21 +0000 |
| commit | 2fa028193c76e6df949d535a37727cdab220a0dc (patch) | |
| tree | b7668d172f21f87e5db774adffb71df36abfe028 /lib/condition.ml | |
| parent | cd592d4c7e2e42425b65d587f2675c3ecec488d9 (diff) | |
| download | Sakura-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.ml | 5 |
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' |
