Loading
Document error propagation behaviour and update Config godoc
Closes the final acceptance criterion gap for team-tasks #4382 by making the error propagation contract explicit in the public API docs.
Changes
BooleanValueDetailsandStringValueDetailsgodoc: explicit statement thatdefaultValueis always returned on failure and errors are propagated for caller observabilitydoc.go: new# Error handlingsection explaining the three guarantees (safe default, observable error, automatic logging when Logger is configured)
Design decision: Option A (errors propagated, not swallowed)
The PREP acceptance criterion said "without propagating an error to the caller" — this MR documents that we deliberately chose the opposite: errors are propagated because:
- Callers who care about observability can inspect them
- The package now also logs automatically when
Config.Loggeris set defaultValueis always safe to use regardless — callers can ignore the error if they choose
Test plan
-
go test ./featureflag/... -count=1— all pass -
go doc gitlab.com/gitlab-org/labkit/v2/featureflagshows the Error handling section
Stack (merge in order)
| # | MR | Status |
|---|---|---|
| 1 | !485 (merged) — Add httptest slow-server timeout test | merge into master first |
| 2 | !486 (merged) — Add slog.Logger observability | retarget to master after !485 (merged) merges |
| 3 | !487 (merged) — Document error propagation ← you are here | retarget to master after !486 (merged) merges |
Edited by Elliot Forbes