Skip to content

Commit

Permalink
🔇 remove useless stacktraces
Browse files Browse the repository at this point in the history
Signed-off-by: Rintaro Okamura <rintaro.okamura@gmail.com>
  • Loading branch information
rinx committed Jun 30, 2020
1 parent 406d981 commit b2f6306
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions pkg/agent/core/ngt/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -359,11 +359,11 @@ func (s *server) CreateIndex(ctx context.Context, c *payload.Control_CreateIndex
err = s.ngt.CreateIndex(ctx, c.GetPoolSize())
if err != nil {
if err == errors.ErrUncommittedIndexNotFound {
log.Warnf("[CreateIndex]\tfailed precondition error\t%+v", err)
log.Warnf("[CreateIndex]\tfailed precondition error\t%s", err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeFailedPrecondition(err.Error()))
}
return nil, status.WrapWithFailedPrecondition("CreateIndex API failed", err)
return nil, status.WrapWithFailedPrecondition(fmt.Sprintf("CreateIndex API failed: %s", err), err)
}

log.Errorf("[CreateIndex]\tUnknown error\t%+v", err)
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/backup/cassandra/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Re
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[GetVector]\tnot found\t%v\t%+v", req.Uuid, err)
log.Warnf("[GetVector]\tnot found\t%v\t%s", req.Uuid, err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -93,7 +93,7 @@ func (s *server) Locations(ctx context.Context, req *payload.Backup_Locations_Re
uuid := req.GetUuid()
ips, err := s.cassandra.GetIPs(ctx, uuid)
if err != nil {
log.Errorf("[Locations]\tnot found\t%+v", err)
log.Errorf("[Locations]\tnot found\t%s", err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/manager/backup/mysql/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Re
meta, err := s.mysql.GetMeta(ctx, uuid)
if err != nil {
if errors.IsErrMySQLNotFound(errors.UnWrapAll(err)) {
log.Warnf("[GetVector]\tnot found\t%v\t%+v", req.Uuid, err)
log.Warnf("[GetVector]\tnot found\t%v\t%s", req.Uuid, err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/manager/compressor/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ func (s *server) GetVector(ctx context.Context, req *payload.Backup_GetVector_Re
uuid := req.GetUuid()
r, err := s.backup.GetObject(ctx, uuid)
if err != nil {
log.Errorf("[GetVector]\tnot found\t%+v", err)
log.Errorf("[GetVector]\tnot found\t%s", err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -91,7 +91,7 @@ func (s *server) Locations(ctx context.Context, req *payload.Backup_Locations_Re
uuid := req.GetUuid()
r, err := s.backup.GetLocation(ctx, uuid)
if err != nil {
log.Errorf("[Locations]\tnot found\t%+v", err)
log.Errorf("[Locations]\tnot found\t%s", err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/meta/cassandra/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (s *server) GetMeta(ctx context.Context, key *payload.Meta_Key) (*payload.M
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[GetMeta]\tnot found\t%v\t%+v", key.GetKey(), err)
log.Warnf("[GetMeta]\tnot found\t%v\t%s", key.GetKey(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -93,7 +93,7 @@ func (s *server) GetMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *pay
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[GetMetas]\tnot found\t%v\t%+v", keys.GetKeys(), err)
log.Warnf("[GetMetas]\tnot found\t%v\t%s", keys.GetKeys(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -128,7 +128,7 @@ func (s *server) GetMetaInverse(ctx context.Context, val *payload.Meta_Val) (*pa
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[GetMetaInverse]\tnot found\t%v\t%+v", val.GetVal(), err)
log.Warnf("[GetMetaInverse]\tnot found\t%v\t%s", val.GetVal(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -166,7 +166,7 @@ func (s *server) GetMetasInverse(ctx context.Context, vals *payload.Meta_Vals) (
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[GetMetasInverse]\tnot found\t%v\t%+v", vals.GetVals(), err)
log.Warnf("[GetMetasInverse]\tnot found\t%v\t%s", vals.GetVals(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -241,7 +241,7 @@ func (s *server) DeleteMeta(ctx context.Context, key *payload.Meta_Key) (*payloa
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[DeleteMeta]\tnot found\t%v\t%+v", key.GetKey(), err)
log.Warnf("[DeleteMeta]\tnot found\t%v\t%s", key.GetKey(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -279,7 +279,7 @@ func (s *server) DeleteMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[DeleteMetas]\tnot found\t%v\t%+v", keys.GetKeys(), err)
log.Warnf("[DeleteMetas]\tnot found\t%v\t%s", keys.GetKeys(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -314,7 +314,7 @@ func (s *server) DeleteMetaInverse(ctx context.Context, val *payload.Meta_Val) (
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[DeleteMetaInverse]\tnot found\t%v\t%+v", val.GetVal(), err)
log.Warnf("[DeleteMetaInverse]\tnot found\t%v\t%s", val.GetVal(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -352,7 +352,7 @@ func (s *server) DeleteMetasInverse(ctx context.Context, vals *payload.Meta_Vals
if err != nil {
switch {
case errors.IsErrCassandraNotFound(errors.UnWrapAll(err)):
log.Warnf("[DeleteMetasInverse]\tnot found\t%v\t%+v", vals.GetVals(), err)
log.Warnf("[DeleteMetasInverse]\tnot found\t%v\t%s", vals.GetVals(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down
16 changes: 8 additions & 8 deletions pkg/meta/redis/handler/grpc/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func (s *server) GetMeta(ctx context.Context, key *payload.Meta_Key) (*payload.M
val, err := s.redis.Get(key.GetKey())
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[GetMeta]\tnot found\t%v\t%+v", key.GetKey(), err)
log.Warnf("[GetMeta]\tnot found\t%v\t%s", key.GetKey(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -82,7 +82,7 @@ func (s *server) GetMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *pay
mv.Vals, err = s.redis.GetMultiple(keys.GetKeys()...)
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[GetMetas]\tnot found\t%v\t%+v", keys.GetKeys(), err)
log.Warnf("[GetMetas]\tnot found\t%v\t%s", keys.GetKeys(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand All @@ -107,7 +107,7 @@ func (s *server) GetMetaInverse(ctx context.Context, val *payload.Meta_Val) (*pa
key, err := s.redis.GetInverse(val.GetVal())
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[GetMetaInverse]\tnot found\t%v\t%+v", val.GetVal(), err)
log.Warnf("[GetMetaInverse]\tnot found\t%v\t%s", val.GetVal(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -135,7 +135,7 @@ func (s *server) GetMetasInverse(ctx context.Context, vals *payload.Meta_Vals) (
mk.Keys, err = s.redis.GetInverseMultiple(vals.GetVals()...)
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[GetMetasInverse]\tnot found\t%v\t%+v", vals.GetVals(), err)
log.Warnf("[GetMetasInverse]\tnot found\t%v\t%s", vals.GetVals(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -200,7 +200,7 @@ func (s *server) DeleteMeta(ctx context.Context, key *payload.Meta_Key) (*payloa
val, err := s.redis.Delete(key.GetKey())
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[DeleteMeta]\tnot found\t%v\t%+v", key.GetKey(), err)
log.Warnf("[DeleteMeta]\tnot found\t%v\t%s", key.GetKey(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -228,7 +228,7 @@ func (s *server) DeleteMetas(ctx context.Context, keys *payload.Meta_Keys) (mv *
mv.Vals, err = s.redis.DeleteMultiple(keys.GetKeys()...)
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[DeleteMetas]\tnot found\t%v\t%+v", keys.GetKeys(), err)
log.Warnf("[DeleteMetas]\tnot found\t%v\t%s", keys.GetKeys(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand All @@ -253,7 +253,7 @@ func (s *server) DeleteMetaInverse(ctx context.Context, val *payload.Meta_Val) (
key, err := s.redis.DeleteInverse(val.GetVal())
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[DeleteMetaInverse]\tnot found\t%v\t%+v", val.GetVal(), err)
log.Warnf("[DeleteMetaInverse]\tnot found\t%v\t%s", val.GetVal(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down Expand Up @@ -281,7 +281,7 @@ func (s *server) DeleteMetasInverse(ctx context.Context, vals *payload.Meta_Vals
mk.Keys, err = s.redis.DeleteInverseMultiple(vals.GetVals()...)
if err != nil {
if errors.IsErrRedisNotFound(errors.UnWrapAll(err)) {
log.Warnf("[DeleteMetasInverse]\tnot found\t%v\t%+v", vals.GetVals(), err)
log.Warnf("[DeleteMetasInverse]\tnot found\t%v\t%s", vals.GetVals(), err.Error())
if span != nil {
span.SetStatus(trace.StatusCodeNotFound(err.Error()))
}
Expand Down

0 comments on commit b2f6306

Please sign in to comment.