claz: print proper error messages
++ fail-command
|= err=tang
^+ this
- ~& 'command processing failed'
- ::TODO error printing
+ %- (slog [leaf+"command processing failed" err])
this(inp ~)
::
:: done-command: handle result of nonce-fetching monad
[%eth-get-transaction-count for]
^- form:m
?. ?=(%s -.json)
- (glad-fail *tang) ::TODO proper error, "unexpected json"
+ (glad-fail [%leaf "weird nonce json response"]~)
%- pure:m
(rash p.json ;~(pfix (jest '0x') hex))
::
;< =response:rpc:jstd bind:m
expect-response
?. ?=(%result -.response)
- (glad-fail *tang) ::TODO make pretty error message
+ (glad-fail [%leaf "json result is unexpected ${(trip -.response)}"]~)
(pure:m res.response)
::
:: transaction generation logic
