Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What's the problem?
When the DNSimple API returns validation errors, although the type of the API error is included in exceptions (
Validation failed
), the details of the error are omitted.For example, if we somehow attempted to put a zone into an inconsistent state (and this passed through the validations in descendants of
RecordStore::Record
) an exception with the following message would be emitted byrecord_store
:This doesn't give us much to go on as far as how to do these validations in
RecordStore
itself.How does this fix it?
It appears as though the DNSimple API includes these details in the
errors
field of responses. This change simply ensures that these details are included in exceptions.So, instead of the error above, this change would add a little bit more flavour:
What do I need from a review
Follow up
And don't worry. I'll follow up by trying to get this change into upstream. If they accept it, we can upgrade the dependancy here, and remove the monkey-patch.