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

docs: Describe how to handle Options as errors #1805

Merged
merged 2 commits into from
Oct 18, 2022

Conversation

har7an
Copy link
Contributor

@har7an har7an commented Oct 17, 2022

Extend the error handling documentation.

@imsnif: You said you wanted to mention the bit about returning an anyhow::Result mentioned in CONTRIBUTING.md. I'm honestly not sure where it fits in there, and I don't want to bloat it needlessly... So I extended the error handling docs and added a TL;DR:

image

Is that alright for you, too?

@har7an har7an temporarily deployed to cachix October 17, 2022 16:12 Inactive
@imsnif
Copy link
Member

imsnif commented Oct 17, 2022

@har7an - this looks great! How about duplicating this in CONTRIBUTING.md under the title How to propagate errors from your functions?

@har7an
Copy link
Contributor Author

har7an commented Oct 17, 2022

I feel like it's a little out of place in CONTRIBUTING.md to be honest. This is sort of a very concrete tip for how to code. Like, where do you draw the line for things we care to mention there?

Since it's likely the first file (after README.md) that potential contributors will read, I wouldn't want to strike them with a wall of text as it grows. I agree we should somehow reference it, but I'm not sure how. Maybe we add a section Tips for code contributions, or Zellij coding best practices and then stick a few very brief examples in there (the TL;DR in this case) along with links to "further reading" (Like the new section in ERROR_HANDLING.md in this case)?

@imsnif
Copy link
Member

imsnif commented Oct 17, 2022

Since it's likely the first file (after README.md) that potential contributors will read, I wouldn't want to strike them with a wall of text as it grows. I agree we should somehow reference it, but I'm not sure how. Maybe we add a section Tips for code contributions, or Zellij coding best practices and then stick a few very brief examples in there (the TL;DR in this case) along with links to "further reading" (Like the new section in ERROR_HANDLING.md in this case)?

Sounds good!

which will be home to condensed tips and best-practices around the
zellij code. Currently explains to prefer returning `Result` types
instead of `unwrap`ing on them.

The tips in here are meant to be short, concise guides that allow the
user to get started without a lot of reading. The individual tips can
(and should) be supplemented with links to "further reading" where the
topic at hand is explained in greater detail.
@har7an har7an temporarily deployed to cachix October 18, 2022 13:43 Inactive
@har7an har7an merged commit 0711591 into zellij-org:main Oct 18, 2022
har7an added a commit that referenced this pull request Oct 18, 2022
Add tips for code contributions to CONTRIBUTING, and expand the error docs with regard to how to handle `Option` types.
@har7an har7an deleted the docs/error-handling-extended branch October 23, 2022 15:48
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

Successfully merging this pull request may close these issues.

None yet

2 participants