mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 20:07:55 -04:00
improve error reporting
This commit is contained in:
parent
7eb75d66d6
commit
8495d469ee
1 changed files with 9 additions and 2 deletions
|
|
@ -136,8 +136,15 @@ end = struct
|
|||
bt)))
|
||||
) else (
|
||||
let dec = Pbrt.Decoder.of_string (Buffer.contents buf_res) in
|
||||
let status = Status.decode_status dec in
|
||||
Error (`Status (code, status))
|
||||
try
|
||||
let status = Status.decode_status dec in
|
||||
Error (`Status (code, status))
|
||||
with e ->
|
||||
let bt = Printexc.get_backtrace () in
|
||||
Error
|
||||
(`Failure
|
||||
(spf "decoding of status failed with:\n%s\n%s"
|
||||
(Printexc.to_string e) bt))
|
||||
)
|
||||
| exception Sys.Break -> Error `Sysbreak
|
||||
| exception Curl.CurlException (_, code, msg) ->
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue