Skip to content

Commit

Permalink
Merge pull request #922 from authzed/more-instances-zerolog-recursion
Browse files Browse the repository at this point in the history
fix more instances of zerolog marshall recursion
  • Loading branch information
vroldanbet authored Oct 20, 2022
2 parents 19600e5 + cf0afd2 commit 2b75a1f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions internal/dispatch/graph/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (err ErrNamespaceNotFound) NotFoundNamespaceName() string {

// MarshalZerologObject implements zerolog.LogObjectMarshaler
func (err ErrNamespaceNotFound) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Str("namespace", err.namespaceName)
e.Err(err.error).Str("namespace", err.namespaceName)
}

// DetailsMetadata returns the metadata for details for this error.
Expand Down Expand Up @@ -56,7 +56,7 @@ func (err ErrRelationNotFound) NotFoundRelationName() string {

// MarshalZerologObject implements zerolog.LogObjectMarshaler
func (err ErrRelationNotFound) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Str("namespace", err.namespaceName).Str("relation", err.relationName)
e.Err(err.error).Str("namespace", err.namespaceName).Str("relation", err.relationName)
}

// DetailsMetadata returns the metadata for details for this error.
Expand Down
4 changes: 2 additions & 2 deletions internal/graph/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ func (err ErrRelationNotFound) NotFoundRelationName() string {
}

func (err ErrRelationNotFound) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Str("namespace", err.namespaceName).Str("relation", err.relationName)
e.Err(err.error).Str("namespace", err.namespaceName).Str("relation", err.relationName)
}

// DetailsMetadata returns the metadata for details for this error.
Expand Down Expand Up @@ -119,7 +119,7 @@ func (err ErrRelationMissingTypeInfo) RelationName() string {
}

func (err ErrRelationMissingTypeInfo) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Str("namespace", err.namespaceName).Str("relation", err.relationName)
e.Err(err.error).Str("namespace", err.namespaceName).Str("relation", err.relationName)
}

// DetailsMetadata returns the metadata for details for this error.
Expand Down
6 changes: 3 additions & 3 deletions internal/services/v1/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type ErrExceedsMaximumUpdates struct {

// MarshalZerologObject implements zerolog object marshalling.
func (err ErrExceedsMaximumUpdates) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Uint16("updateCount", err.updateCount).Uint16("maxCountAllowed", err.maxCountAllowed)
e.Err(err.error).Uint16("updateCount", err.updateCount).Uint16("maxCountAllowed", err.maxCountAllowed)
}

// GRPCStatus implements retrieving the gRPC status for the error.
Expand Down Expand Up @@ -69,7 +69,7 @@ type ErrExceedsMaximumPreconditions struct {

// MarshalZerologObject implements zerolog object marshalling.
func (err ErrExceedsMaximumPreconditions) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Uint16("preconditionCount", err.preconditionCount).Uint16("maxCountAllowed", err.maxCountAllowed)
e.Err(err.error).Uint16("preconditionCount", err.preconditionCount).Uint16("maxCountAllowed", err.maxCountAllowed)
}

// GRPCStatus implements retrieving the gRPC status for the error.
Expand Down Expand Up @@ -139,7 +139,7 @@ type ErrPreconditionFailed struct {

// MarshalZerologObject implements zerolog object marshalling.
func (err ErrPreconditionFailed) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Interface("precondition", err.precondition)
e.Err(err.error).Interface("precondition", err.precondition)
}

// NewPreconditionFailedErr constructs a new precondition failed error.
Expand Down
2 changes: 1 addition & 1 deletion pkg/caveats/parameters.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ type ParameterConversionErr struct {

// MarshalZerologObject implements zerolog.LogObjectMarshaler
func (err ParameterConversionErr) MarshalZerologObject(e *zerolog.Event) {
e.Err(err).Str("parameterName", err.parameterName)
e.Err(err.error).Str("parameterName", err.parameterName)
}

// DetailsMetadata returns the metadata for details for this error.
Expand Down

0 comments on commit 2b75a1f

Please sign in to comment.