Skip to content
This repository was archived by the owner on Dec 28, 2024. It is now read-only.

Commit

Permalink
fix: truncate http rpc error logs
Browse files Browse the repository at this point in the history
  • Loading branch information
palkan committed Apr 3, 2024
1 parent 575f9ab commit 30c786c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rpc/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"net/url"
"time"

"github.com/anycable/anycable-go/logger"
pb "github.com/anycable/anycable-go/protos"
"github.com/anycable/anycable-go/utils"
"github.com/sony/gobreaker"
Expand Down Expand Up @@ -210,7 +211,7 @@ func (s *HTTPService) performRequest(ctx context.Context, path string, payload [
return nil, status.Error(codes.InvalidArgument, "unprocessable entity")
}

return nil, status.Error(codes.InvalidArgument, string(reason))
return nil, status.Error(codes.InvalidArgument, logger.CompactValue(reason).String())
}

if res.StatusCode != http.StatusOK {
Expand All @@ -219,7 +220,7 @@ func (s *HTTPService) performRequest(ctx context.Context, path string, payload [
return nil, status.Error(codes.Unknown, "internal error")
}

return nil, status.Error(codes.Unknown, string(reason))
return nil, status.Error(codes.Unknown, logger.CompactValue(reason).String())
}

// Finally, the response is successful, let's read the body
Expand Down

0 comments on commit 30c786c

Please sign in to comment.