Skip to content

Commit

Permalink
%w is not supported in api.LogX (#303)
Browse files Browse the repository at this point in the history
The `api.LogX` uses `fmt.Sprintf` under the hover, which doesn't support
%w.
Signed-off-by: spacewander <[email protected]>
  • Loading branch information
spacewander authored Feb 21, 2024
1 parent cb88689 commit e7023ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/casbin/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ func (f *filter) DecodeHeaders(headers api.RequestHeaderMap, endStream bool) api

e, err := casbin.NewEnforcer(conf.Rule.Model, conf.Rule.Policy)
if err != nil {
api.LogErrorf("failed to update Enforcer: %w", err)
api.LogErrorf("failed to update Enforcer: %v", err)
// next request will retry
} else {
conf.lock.Lock()
Expand All @@ -68,7 +68,7 @@ func (f *filter) DecodeHeaders(headers api.RequestHeaderMap, endStream bool) api

if !ok {
if err != nil {
api.LogErrorf("failed to enforece %s: %w", role, err)
api.LogErrorf("failed to enforece %s: %v", role, err)
}
api.LogInfof("reject forbidden user %s", role)
return &api.LocalResponse{
Expand Down

0 comments on commit e7023ad

Please sign in to comment.