letsencrypt / letsencrypt/boulder
wfe: change error-handling paradigm
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 5.8k
- Forks
- 649
- Avg merge
- 3d 23h
- Merged PRs (30d)
- 24
Description
Right now our HTTP handlers in wfe and wfe2 follow the API used by net/http: To return an error, you have to set the status code and write the error body, then return. This leaves a possibility of forgetting to write the return. We should write wrappers such that our handlers return error instead, and the wrappers handle setting the status code and sending the error body. This would reduce that chance of such mistakes. Thanks to @yuriks for the idea.
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
Start by reading the HTTP handlers in wfe and wfe2 and comparing their current net/http error handling. Define how handlers returning error should be wrapped, including status-code and error-body behavior. Done means both handler areas consistently use the new return-error paradigm without relying on callers to write the response.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100