Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ociregistry/ociserver: pass request into WriteError
This gives the `WriteError` function the capability to inspect the request in order to form the error (for example to extract the context or log some request parameters). We also change its signature so it's clear that the error is discarded - in general this is the strategy taken by most HTTP servers anyway as clients tend to disappear without warning, so logging errors in this case is just noise. We leave the signature of `ociregistry.WriteError` the same so it's possible for a caller to use that error if they want, and also to make it clear that it does not use the `http.Request` to inform the result. Signed-off-by: Roger Peppe <[email protected]> Change-Id: Ifdbc2ea509385b28479a064f4c2b13686cba5f7f Dispatch-Trailer: {"type":"trybot","CL":1193024,"patchset":1,"ref":"refs/changes/24/1193024/1","targetBranch":"main"}
- Loading branch information