Skip to content

Commit

Permalink
Use vanilla errors
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdiep committed Oct 27, 2020
1 parent aa86f53 commit b182d35
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pubsublite/message.go
Expand Up @@ -15,13 +15,12 @@ package pubsublite

import (
"crypto/sha256"
"fmt"
"math/big"
"math/rand"
"time"

"github.com/golang/protobuf/ptypes"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"

pb "google.golang.org/genproto/googleapis/cloud/pubsublite/v1"
)
Expand Down Expand Up @@ -65,7 +64,7 @@ func (m *Message) toProto() (*pb.PubSubMessage, error) {
if !m.EventTime.IsZero() {
ts, err := ptypes.TimestampProto(m.EventTime)
if err != nil {
return nil, status.Errorf(codes.FailedPrecondition, "pubsublite: error converting message timestamp: %v", err)
return nil, fmt.Errorf("pubsublite: error converting message timestamp: %v", err)
}
msgpb.EventTime = ts
}
Expand Down

0 comments on commit b182d35

Please sign in to comment.