Open udirom opened 3 years ago
@kphfb
@gdanezis I know awhile back that you were putting together a listing of the error codes. Should we either put out a new LIP for error handling or point this LIP to the code?
Hi all,
On 1, the reference api has a list of errors it emits here: https://github.com/libra/off-chain-reference/blob/master/src/offchainapi/errors.py Happy to add more docs or add an appendix to the LIP1 to enumerate and document these. Also open to feedback about what other error codes could be useful.
On 2, we currently should be sending 200 OK if the command was successful and 400 if it is a failure: https://github.com/libra/off-chain-reference/blob/eba72f53d4962fccd2033c98500c06bfaaacf4e2/src/offchainapi/asyncnet.py#L174
G
On 1, the reference api has a list of errors it emits here: https://github.com/libra/off-chain-reference/blob/master/src/offchainapi/errors.py Happy to add more docs or add an appendix to the LIP1 to enumerate and document these. Also open to feedback about what other error codes could be useful.
On 2, we currently should be sending 200 OK if the command was successful and 400 if it is a failure: https://github.com/libra/off-chain-reference/blob/eba72f53d4962fccd2033c98500c06bfaaacf4e2/src/offchainapi/asyncnet.py#L174
This could be a temporary solution, for now, but eventually it should be defined in a LIP.