diff --git a/fcm.go b/fcm.go index 0d53062..230d389 100644 --- a/fcm.go +++ b/fcm.go @@ -211,7 +211,7 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl ) if response.StatusCode != http.StatusOK { - err := errors.Errorf("Status is not OK. Status: %d. Body: %s", response.StatusCode, bodyStr) + err := errors.Errorf("Status is not OK. Status: %d. Body: %q.", response.StatusCode, bodyStr) span.SetStatus(codes.Error, err.Error()) span.RecordError(err) return SendResponse{}, err @@ -219,7 +219,7 @@ func (c *Client) doSendRequest(ctx context.Context, req SendRequest, loggerEnabl var resp SendResponse if err := json.Unmarshal(body, &resp); err != nil { - newErr := errors.Errorf("Can not parse send response as JSON. Response: %q. Error: %v", string(body), err) + newErr := errors.Errorf("Can not parse send response as JSON. Response: %q. Error: %v", bodyStr, err) span.SetStatus(codes.Error, err.Error()) span.RecordError(err) return SendResponse{}, newErr