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

Improve endpiont descriptions #5

Open
lightclient opened this issue May 10, 2022 · 1 comment
Open

Improve endpiont descriptions #5

lightclient opened this issue May 10, 2022 · 1 comment

Comments

@lightclient
Copy link
Member

I think it makes sense to write the error conditions first. They are essentially the abort conditions

  • if any of these, error
    • otherwise, return this (with these conditions on values)

rather than

  • return this!
    • but don't do that if any of these error conditions
@staccDOTsol
Copy link

You're absolutely right! It's generally a good practice to prioritize error conditions in endpoint descriptions. By explicitly stating the potential error scenarios upfront, developers can better understand the potential pitfalls and design their code accordingly. This approach helps ensure that the desired behavior is achieved while also accounting for any potential issues that may arise. Thank you for highlighting this important aspect of writing endpoint descriptions!

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

2 participants