minima-global / Minima

The Minima protocol Java libraries and application
Apache License 2.0
129 stars 146 forks source link

Error handling consistency #560

Closed eliasnemr closed 1 year ago

eliasnemr commented 2 years ago

I've come across some inconsistency when working with mds/terminal minidapp and testing out different commands that the errors received with some commands had different json format of errors. In other words..

A send command without all required parameters, send amount:1 returns:

Screenshot 2022-03-29 at 5 04 49 PM Notice there there is an error key pair value with a message explaining the error.

However, a send command when you don't have sufficient balance returns:

Screenshot 2022-03-29 at 5 05 51 PM

with a message key pair value instead.

Is it possible to keep them consistent?

Suggestion Suggestion for an enhancement; perhaps an improved error handling system with error codes and an appropriate message OR documenting each error code accordingly.