-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Currently, if RPC error occurs, the error message just gives
unexpected end of JSON input
Because the error format provided by the rpc server is as follows:
{
code: -32032,
message: 'Not Enough Balance',
data: 'InsufficientBalance { address: Address(~~), balance: ~, cost: ~ }'
}
unexpected end of JSON input
comes from line 75.
(body
has the error message in byte slice)
Lines 64 to 77 in 6ad3e76
resp, err := client.httpClient.Do(req) | |
if err != nil { | |
return err | |
} | |
defer resp.Body.Close() | |
body, readerr := ioutil.ReadAll(resp.Body) | |
if readerr != nil { | |
return readerr | |
} | |
var outerResult Result | |
if err := json.Unmarshal(body, &outerResult); err != nil { | |
return err | |
} |
Metadata
Metadata
Assignees
Labels
No labels