Skip to content

Conversation

@dabrahams
Copy link
Collaborator

No description provided.

Copy link
Member

@camio camio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hopefully this submits the comments I made here. They ma have gotten lost?

@camio
Copy link
Member

camio commented Jan 28, 2026

Looks like you made a different PR? Here are my comments on the old one: #39 (review)

@dabrahams
Copy link
Collaborator Author

Looks like you made a different PR? Here are my comments on the old one: #39 (review)

Thanks; they were good. I mistakenly deleted the branch in the server, which closed the PR.


##### Documenting Mutating Functions

When a runtime error occurs partway through a mutating operation, a a
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
When a runtime error occurs partway through a mutating operation, a a
When a runtime error occurs partway through a mutating operation, a

@RishabhRD
Copy link
Contributor

I was wondering if it is worthy to provide wisdom on some of common error handling (mis)conceptions widely spread in industry:

  1. try/catch just to log and rethrow.
  2. Enriching the error with "context". Rust's anyhow::Context is an example and thus is becoming common practice. Usually done by throwing a custom error type that wraps the error thrown by functions called by callee.
  3. Adding StackTrace to the error.

I have noticed the above patterns are common for "backend" applications (applications running on server, interacting with DB, etc).

I know the points I mentioned has nothing to do with correctness of the program and might be very contextual but the reason for pointing this out is I have noticed multiple people exchanging multiple theories/libraries around similar ideas(an example from r/rust) without even talking about design by contract. Maybe addressing this would help them.

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.

4 participants