-
Notifications
You must be signed in to change notification settings - Fork 35
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
Json parse failure handling #156
Conversation
Catch MultiJson::ParseError exceptions and return a SparkApi::InvalidJSON exception instead
@@ -1,3 +1,9 @@ | |||
v2.0.0 | |||
- Drop support for ruby 1.9.3, require a minimum of ruby 2.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋
spark_api.gemspec
Outdated
s.add_development_dependency 'rb-readline' | ||
s.add_development_dependency 'rb-fsevent' | ||
s.add_development_dependency 'simplecov' | ||
s.add_development_dependency 'rake' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm OK with keeping the dependencies pretty wide open, but you may want to be tighter on dev dependencies. This is of course assuming we don't checking a lock file.
I don't have a clear solution here, but there is a definite problem with working on a gem because one's local versions are vastly different from the main author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps a guideline here is to limit to >= an exact version that is known to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand you correctly, you're talking about the problem that happens when your local copy has preinstalled gems, and the tests all pass, but the from-scratch job on Travis or our build server fails, either when installing deps or because a changed dependency caused a test to fail?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, exactly. Everything works fine up until a new version of the dependency is released, and trashes your next build. It's a nuisance, and can be downright maddening to figure out the last good list of deps.
As to your questions, I very much think it's worthwhile handling these errors in the gem, and present a more appropriate message. The multijson response is rather terrible. Including the request and response information as a part of the error is something I've wanted to do for a long time, hell, even providing a clean manner to log this information for successful requests wouldn't be bad, so long as overhead was manageable, or at least the feature was configurable. |
Apologies: I unintentionally made this PR against |
MUCH SMALLER |
if you want to review the v2 changes, those are over here 👉 #153 😄 |
Trying to wrap up the few outstanding v2 changes and I need some design input on this one
I can't remember if we have an internal ticket tracking this and didn't find one when I looked briefly.
questions: