mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 20:33:36 -04:00
print received status when httpclient fails
This commit is contained in:
parent
8495d469ee
commit
d3b366f04b
1 changed files with 9 additions and 3 deletions
|
|
@ -135,7 +135,9 @@ end = struct
|
||||||
(spf "decoding failed with:\n%s\n%s" (Printexc.to_string e)
|
(spf "decoding failed with:\n%s\n%s" (Printexc.to_string e)
|
||||||
bt)))
|
bt)))
|
||||||
) else (
|
) else (
|
||||||
let dec = Pbrt.Decoder.of_string (Buffer.contents buf_res) in
|
let str = Buffer.contents buf_res in
|
||||||
|
let dec = Pbrt.Decoder.of_string str in
|
||||||
|
|
||||||
try
|
try
|
||||||
let status = Status.decode_status dec in
|
let status = Status.decode_status dec in
|
||||||
Error (`Status (code, status))
|
Error (`Status (code, status))
|
||||||
|
|
@ -143,8 +145,12 @@ end = struct
|
||||||
let bt = Printexc.get_backtrace () in
|
let bt = Printexc.get_backtrace () in
|
||||||
Error
|
Error
|
||||||
(`Failure
|
(`Failure
|
||||||
(spf "decoding of status failed with:\n%s\n%s"
|
(spf
|
||||||
(Printexc.to_string e) bt))
|
"decoding of status (code=%d) failed with:\n\
|
||||||
|
%s\n\
|
||||||
|
status: %S\n\
|
||||||
|
%s"
|
||||||
|
code (Printexc.to_string e) str bt))
|
||||||
)
|
)
|
||||||
| exception Sys.Break -> Error `Sysbreak
|
| exception Sys.Break -> Error `Sysbreak
|
||||||
| exception Curl.CurlException (_, code, msg) ->
|
| exception Curl.CurlException (_, code, msg) ->
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue