eosjs icon indicating copy to clipboard operation
eosjs copied to clipboard

EOSJS - any error for a transaction returns same error msg/exception

Open amolmaid opened this issue 8 years ago • 3 comments

I am using eosjs in my dAPP, where I am executing few transactions like issue and transfer. While doing so lets say I/user does something wrong while doing transfer

  • May be he inserts wrong/invalid symbol name,
  • or quantity precision is in-correct
  • or transfer quantity exceeds the total available balance For any of the above action, eosjs returns me the same type of error message, {"code":500,"message":"Internal Service Error","error":{"code":3050003,"name":"eosio_assert_message_exception","what":"eosio_assert_message assertion failure","details":[]}}

While at the same time, nodeos returns me the precise error message like, exception msg-04 19-54-48

SO do we have anything which will give me this kind more accurate error message like nodeos, so I can render it on page by which user could correct his mistake ?

amolmaid avatar Sep 04 '18 14:09 amolmaid

I suspect it might be in here "details":[] if the API endpoint had started nodeosd with --verbose-http-errors .. I'm not sure what the trade-off is for enabling it and why it is off by default.

There is some example code parsing details in another issue, we can find it if you need it.

jcalfee avatar Sep 04 '18 15:09 jcalfee

Ohh great, Thank you for your response, this suffice my need here, I am able to get the precise error msg now. So thank you :)

amolmaid avatar Sep 04 '18 15:09 amolmaid

I suspect it might be in here "details":[] if the API endpoint had started nodeosd with --verbose-http-errors .. I'm not sure what the trade-off is for enabling it and why it is off by default.

There is some example code parsing details in another issue, we can find it if you need it.

wow~ thank you again~

clockknock avatar Nov 15 '18 12:11 clockknock