Skip to content

Document functions that throw or improve with Result type #3825

Closed
@jsjoeio

Description

@jsjoeio

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

Metadata

Metadata

Assignees

Labels

choreRelated to maintenance or clean upenhancementSome improvement that isn't a feature

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions