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

Document functions that throw or improve with Result type #3825

Closed
jsjoeio opened this issue Jul 20, 2021 · 1 comment
Closed

Document functions that throw or improve with Result type #3825

jsjoeio opened this issue Jul 20, 2021 · 1 comment
Assignees
Labels
chore Related to maintenance or clean up enhancement Some improvement that isn't a feature
Milestone

Comments

@jsjoeio
Copy link
Contributor

jsjoeio commented Jul 20, 2021

Prior Art

It's really a shame TypeScript has no support for throwing.

I gave this a thumbs up: microsoft/TypeScript#13219

Thoughts on (I'm thinking we could do this later since we have a lot of throw around) using a sort of DocBlock syntax with @throws? Similar to the example in this issue: microsoft/TypeScript#43528

We could also consider (at a later date, not in this PR) not using throw at all in our codebase and always returning something like Rust's Result.

Context: #3760 (comment)

Solution:

  • either document functions with @throws like this example
  • create a new ReturnType like Result in Rust
  • upvote this issue
@jsjoeio jsjoeio added the feature New user visible feature label Jul 20, 2021
@jsjoeio jsjoeio self-assigned this Jul 20, 2021
@jsjoeio jsjoeio added chore Related to maintenance or clean up enhancement Some improvement that isn't a feature and removed feature New user visible feature labels Jul 20, 2021
@jsjoeio jsjoeio added this to the Backlog milestone Jul 20, 2021
@stale
Copy link

stale bot commented Jan 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.

@stale stale bot added the stale label Jan 16, 2022
@stale stale bot closed this as completed Jan 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Related to maintenance or clean up enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

1 participant