eos-php
eos-php copied to clipboard
Error messages get truncated.
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...)
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();
}