eos-php icon indicating copy to clipboard operation
eos-php copied to clipboard

Error messages get truncated.

Open str opened this issue 7 years ago • 1 comments

If I try to get an invalid account name, I get a truncated error message:

Server error: `POST http://test.eosbp.network:8888/v1/chain/get_account` resulted in a `500 Internal Server Error` response:
{"code":500,"message":"Internal Service Error","error":{"code":3010001,"name":"name_type_exception","what":"Invalid name (truncated...)

str avatar Jul 03 '18 23:07 str

good catch! I will update the lib with a nicer solution ( or feel free to do a PullRequest <3 :D ), but for now you could catch the error something like that:

try {
    $block = $client->chain()->getBlock(545435435354353);
} catch (\GuzzleHttp\Exception\ServerException $ex) {
    $error = $ex->getResponse()->getBody()->getContents();
}

kesar avatar Jul 08 '18 20:07 kesar