Gopher Robot submitted the change![Open in Gerrit]()
Change information
Commit message:
internal/api: refactor error handling to increase consistency
- Refactored error handling to avoid leaking internal implementation
details. Database and system errors are masked by falling back to
standard HTTP statuses but still logging the entire error context.
- User facing error messages can now be specified within the Error
struct.
- Added helpers in types.go to simplify error construction.
- Updated ServeModuleVersions to explicitly return 404 when no versions
are found.
- Expanded test coverage in api_test.go to include 404 and 400 edge
cases.
Change-Id: I89c4be3941126c15df6aefdd21e4bbd2d3b23be1
Files:
- M internal/api/api.go
- M internal/api/api_test.go
- M internal/api/params.go
- M internal/api/types.go
- M internal/frontend/server.go
Change size: M
Delta: 5 files changed, 130 insertions(+), 38 deletions(-)
Branch: refs/heads/master
Open in Gerrit
Gerrit-MessageType: merged
Gerrit-Project: pkgsite
Gerrit-Branch: master
Gerrit-Change-Id: I89c4be3941126c15df6aefdd21e4bbd2d3b23be1
Gerrit-Change-Number: 764820
Gerrit-PatchSet: 2