chiark / gitweb /
client: Better handling of JSON deser failures
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Feb 2024 15:28:20 +0000 (15:28 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 2 Feb 2024 22:56:25 +0000 (22:56 +0000)
commitd1379aa0291bd50795a49b5dced17edc36a06675
tree9bf629d14e27a2068b7dc6f74ab5503a66e798d1
parent38d6f7720c7fd8d6f64468a4638c776e9358f2e8
client: Better handling of JSON deser failures

If the returned JSON doesn't match the schema implied by our struct,
we now print (a normalised form of) the JSON as part of our error.

If the input isn't JSON at all, we don't include the malformed JSON
text.  It might be hazardous.
src/client.rs
src/text.rs