Client: better error messages for unwrapped JSON objects.
This commit is contained in:
parent
55ad294595
commit
01dd7d152a
@ -395,6 +395,10 @@ let call raw_url (cctxt : #Client_context.full) =
|
|||||||
let call_with_json raw_url json (cctxt: #Client_context.full) =
|
let call_with_json raw_url json (cctxt: #Client_context.full) =
|
||||||
let uri = Uri.of_string raw_url in
|
let uri = Uri.of_string raw_url in
|
||||||
match Data_encoding.Json.from_string json with
|
match Data_encoding.Json.from_string json with
|
||||||
|
| exception Assert_failure _ ->
|
||||||
|
(* Ref : https://github.com/mirage/ezjsonm/issues/31 *)
|
||||||
|
cctxt#error
|
||||||
|
"Failed to parse the provided json: unwrapped JSON value.\n%!"
|
||||||
| Error err ->
|
| Error err ->
|
||||||
cctxt#error
|
cctxt#error
|
||||||
"Failed to parse the provided json: %s\n%!"
|
"Failed to parse the provided json: %s\n%!"
|
||||||
|
Loading…
Reference in New Issue
Block a user