Document built-in exceptions#880
Merged
fhammerschmidt merged 4 commits intomasterfrom Jun 12, 2024
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
fhammerschmidt
requested changes
Jun 10, 2024
| # Exception | ||
|
|
||
| Exceptions are just a special kind of variant, thrown in **exceptional** cases (don't abuse them!). | ||
| Exceptions are just a special kind of variant, thrown in **exceptional** cases (don't abuse them!). Consider using the `option` or `result` type for recoverable errors. |
Member
There was a problem hiding this comment.
Link to the corresponding docs page(s) for Option and Result please.
Collaborator
Author
There was a problem hiding this comment.
we don't have documented the result builtin type
Collaborator
Author
There was a problem hiding this comment.
maybe add Result page after Null, Undefined and Option
Member
There was a problem hiding this comment.
Thanks. Yes we need to document Result somewhere, but we can fix the link afterwards.
Or just link to the Core Result Api page for now?
fhammerschmidt
requested changes
Jun 11, 2024
| You can also make your own exceptions like you'd make a variant (exceptions need to be capitalized too). | ||
| ### `Invalid_argument` | ||
|
|
||
| Used to check if argument is valid. This exception takes a string |
| Error: new Error() | ||
| }; | ||
| Exception raised to signal that the given arguments do not make sense. This | ||
| exception take a string as argument. |
Member
There was a problem hiding this comment.
takes a string as an argument
fhammerschmidt
approved these changes
Jun 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #872