tiny refactor

This commit is contained in:
Simon Cruanes 2022-03-24 11:25:59 -04:00
parent 901730583c
commit 25da9c4ccc
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -470,8 +470,9 @@ module Trace = struct
let span_id = Span_id.create() in
let scope = {trace_id;span_id;events=[]; attrs} in
let finally ok =
let status = match ok with
(* called once we're done, to emit a span *)
let finally res =
let status = match res with
| Ok () -> default_status ~code:Status_code_ok ()
| Error e -> default_status ~code:Status_code_error ~message:e () in
let span, _ =