mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
CLI: Handle non-json responses (#1749)
This commit is contained in:
parent
db7af37ac5
commit
e7b4ec5a1b
@ -1062,11 +1062,11 @@ object ConsoleCli {
|
||||
case Right(response) => response
|
||||
}
|
||||
|
||||
val js = ujson.read(rawBody)
|
||||
val jsObjT =
|
||||
Try(js.obj).transform[mutable.LinkedHashMap[String, ujson.Value]](
|
||||
Success(_),
|
||||
_ => error(s"Response was not a JSON object! Got: $rawBody"))
|
||||
Try(ujson.read(rawBody).obj)
|
||||
.transform[mutable.LinkedHashMap[String, ujson.Value]](
|
||||
Success(_),
|
||||
_ => error(s"Response was not a JSON object! Got: $rawBody"))
|
||||
|
||||
/** Gets the given key from jsObj if it exists
|
||||
* and is not null */
|
||||
|
Loading…
Reference in New Issue
Block a user