Skip to content

Commit

Permalink
Add a more specific error on I/O timeouts. (#1340)
Browse files Browse the repository at this point in the history
Fixes NSL-4411
  • Loading branch information
n-g authored Oct 15, 2024
1 parent 5462cbb commit 3e63023
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/fnapi/fnapi.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,11 @@ func (c Call[RequestT]) Do(ctx context.Context, request RequestT, resolveEndpoin

response, err := client.Do(httpReq)
if err != nil {
// https://cs.opensource.google/go/go/+/master:src/net/net.go;l=628;drc=869932d700cf161c19eec65d66b9fe55482698db
if errors.Is(err, context.DeadlineExceeded) {
return fnerrors.InvocationError("namespace api", "unable to contact %v: %w", endpoint, err)
}

return fnerrors.InvocationError("namespace api", "http call failed: %w", err)
}

Expand Down

0 comments on commit 3e63023

Please sign in to comment.