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

Log an error if we abort the request to ReadMe #75

Merged
merged 1 commit into from
Aug 27, 2020
Merged

Conversation

JoelQ
Copy link
Contributor

@JoelQ JoelQ commented Aug 27, 2020

🧰 What's being changed?

When something goes wrong in the middleware, we rescue and just return
to the next middleware in the chain.

This commit adds some logging in that case so that users can better
understand why some requests aren't being submitted to the ReadMe API.
This might be due to a bug in this middleware (in which case this error
will allow users to create better bug reports), or it might be due to a
malformed body (in which case surfacing that to the user is helpful).

🧪 Testing

Create a rack app and set up the readme middleware with an allow/reject parameter config. Then make a request that has a content type of application/json but whose body is not JSON:

curl 'http://localhost:9292/api/foo' -X POST -d "not json" -H 'Content-Type: application/json'

Check your logs, you should see an error informing you why the request was not logged to ReadMe:

Monosnap 2020-08-27 15-48-34

When something goes wrong in the middleware, we rescue and just return
to the next middleware in the chain.

This commit adds some logging in that case so that users can better
understand why some requests aren't being submitted to the ReadMe API.
This might be due to a bug in this middleware (in which case this error
will allow users to create better bug reports), or it might be due to a
malformed body (in which case surfacing that to the user is helpful).
@JoelQ JoelQ merged commit 8c03b00 into master Aug 27, 2020
@JoelQ JoelQ deleted the jq-log-error branch August 27, 2020 20:07
djmango pushed a commit to djmango/metrics-sdks that referenced this pull request Sep 19, 2023
Bumps [minimist](https://github.com/substack/minimist) from 0.0.8 to 1.2.5. **This update includes security fixes.**
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/0.0.8...1.2.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
@erunion erunion added ruby Issues related to our Ruby SDK and removed area:ruby labels Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Issues related to our Ruby SDK
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants