Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Argus 237 #446

Merged
merged 4 commits into from
Mar 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- [Incomplete log error message #237](https://github.com/xmidt-org/argus/issues/237)

## [v0.9.9]
- Update bascule config for docker [#433]](https://github.com/xmidt-org/argus/pull/433)
Expand Down
5 changes: 3 additions & 2 deletions argus.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ logging:
level: debug
development: true
encoderConfig:
messageKey: msg
levelKey: level
messageKey: message
levelKey: key
levelEncoder: lowercase

health:
disableLogging: false
Expand Down
10 changes: 5 additions & 5 deletions store/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ import (

// Sentinel internal errors.
var (
ErrItemNotFound = errors.New("Item at resource path not found")
ErrJSONDecode = errors.New("Error decoding JSON data from DB")
ErrJSONEncode = errors.New("Error encoding JSON data to send to DB")
ErrQueryExecution = errors.New("Error occurred during DB query execution")
ErrItemNotFound = errors.New("item at resource path not found")
ErrJSONDecode = errors.New("error decoding JSON data from DB")
ErrJSONEncode = errors.New("error encoding JSON data to send to DB")
ErrQueryExecution = errors.New("error occurred during DB query execution")
)

// Sentinel errors to be used by the HTTP response error encoder.
var (
ErrHTTPItemNotFound = &erraux.Error{Err: errors.New("Item not found"), Code: http.StatusNotFound}
ErrHTTPItemNotFound = &erraux.Error{Err: errors.New("item not found"), Code: http.StatusNotFound}
ErrHTTPOpFailed = &erraux.Error{Err: errors.New("DB operation failed"), Code: http.StatusInternalServerError}
)

Expand Down
4 changes: 2 additions & 2 deletions store/provide.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ func buildInputRegexValidators(userInputValidation UserInputValidationConfig, co
bucketFormatRegex := useOrDefault(userInputValidation.BucketFormatRegex, BucketFormatRegexSource)
bucketRegex, err := regexp.Compile(bucketFormatRegex)
if err != nil {
return fmt.Errorf("Bucket %w: %v", errRegexCompilation, err)
return fmt.Errorf("bucket %w: %v", errRegexCompilation, err)
}
config.BucketFormatRegex = bucketRegex

ownerFormatRegex := useOrDefault(userInputValidation.OwnerFormatRegex, OwnerFormatRegexSource)
ownerRegex, err := regexp.Compile(ownerFormatRegex)
if err != nil {
return fmt.Errorf("Owner %w: %v", errRegexCompilation, err)
return fmt.Errorf("owner %w: %v", errRegexCompilation, err)
}
config.OwnerFormatRegex = ownerRegex

Expand Down
2 changes: 1 addition & 1 deletion store/transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func encodeError(getLogger func(context.Context) *zap.Logger) kithttp.ErrorEncod

logger := getLogger(ctx)
if logger != nil && code != http.StatusNotFound {
logger.Error("sending non-200, non-404 response", zap.Error(err), zap.Int("statusCode", code))
logger.Error("sending non-200, non-404 response", zap.Error(err), zap.Int("code", code))
}

w.WriteHeader(code)
Expand Down