letsencrypt / letsencrypt/boulder

Always return error interface rather than specific types

Open
#2,254 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted kind/cleanup
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.