letsencrypt / letsencrypt/boulder
Always return error interface rather than specific types
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 649
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 24
Description
In this excellent talk, Francesc Campoy recommends to always return the error interface for errors, rather than specific examples. This helps avoid tricky bugs related to the "non-nil interface can contain a boxed nil" pattern. We return *ProblemDetails in a few places, intending to more clearly document that those functions always return a *ProblemDetails, not some other error. However, we should probably change that.
Direct link to most relevant bit: https://youtu.be/ynoY2xz-F8s?t=699
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Search the repository for functions that return *ProblemDetails and inspect their callers and existing Go tests. Confirm which signatures are covered by this issue, then update the relevant returns consistently and verify the affected tests pass without boxed-nil errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100