Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LIP-1 - Error handling #78

Open
udirom opened this issue Oct 21, 2020 · 4 comments
Open

LIP-1 - Error handling #78

udirom opened this issue Oct 21, 2020 · 4 comments

Comments

@udirom
Copy link

udirom commented Oct 21, 2020

  1. "Note: Additional information detailing all errors will be added." - I saw protocol & command errors do exist in reference implementation. Maybe they should be added to the document as well?
  2. It is not clear from the description of how error handling should be handled at the HTTP level. Are protocol errors should be returned with 200OK?
@longbowlu
Copy link
Contributor

@kphfb

@kphfb
Copy link
Contributor

kphfb commented Oct 24, 2020

@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?

@gdanezis
Copy link
Contributor

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

@yanivmo
Copy link

yanivmo commented Oct 27, 2020

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants