Releases: wrapp/instrumentation
Releases · wrapp/instrumentation
Updated packages and go 1.19
What's Changed
- Update packages by @aronbirkir in #23
- fix type by @aronbirkir in #24
Full Changelog: v0.2.10...v0.3.0
Adding fail handler for validation errors
Adding a new client manager method (client.HasValidationErrors) for checking for validation messages in a http response.
Usage Example:
resp, err := c.httpClient.Post(ctx, url, client.Body(requestPayload),
client.FailOn(client.HasValidationErrors(errors.OfferCreationError)),
client.FailOn(client.StatusIsNot(errors.OfferCreationError, http.StatusCreated, http.StatusBadRequest)))
if err != nil {
return "", err
}
The message of the error given to the handler will be returned as the main error message.
If the handler finds validation errors, the error returned is a ValidationErrors with the following structure:
struct {
Message string `json:"message"`
Valid bool `json:"valid"`
Errors []FieldError `json:"errors"`
}
and the FieldError struct:
struct {
Context string `json:"context"`
Field string `json:"field"`
Expected string `json:"expected"`
Given string `json:"given"`
}
v0.2.9: Adding X-Amzn-Trace-Id
REWARDS-1940: Adding X-Amzn-Trace-Id Header to middlewares, clients a… …nd logs (#21) * adding new awstraceid helper * defualt to use aws-trace-id forwarding * add default print of aws-trace-id * change var-comment
v0.2.9-experimental: Adding X-Amzn-Trace-Id
change var-comment
v0.2.8: Address memory leak on failed FailManagers
add body.Close() on check (#19) * add body.Close() on check * read body before closing
v0.2.7: Merge pull request #20 from wrapp/session-id
Adding a sessionid that extracts the session id from the request and injects it in the context.
v0.2.6: Merge pull request #18 from wrapp/logs-shortcut
v0.2.5: Merge pull request #16 from wrapp/status-is-not
v0.2.4: Merge pull request #15 from wrapp/status-between
adding StatusBetween FailManager
Pin aws-sdk version to not slow version
Merge pull request #14 from wrapp/pin-aws-sdk pin aws sdk version to eariler