Skip to content

Comments

Add invalid document error handling#465

Merged
jonnyom merged 1 commit intomasterfrom
jonny/add_invalid_document_error
Mar 26, 2019
Merged

Add invalid document error handling#465
jonnyom merged 1 commit intomasterfrom
jonny/add_invalid_document_error

Conversation

@jonnyom
Copy link
Contributor

@jonnyom jonnyom commented Mar 26, 2019

Why?

We should be catching and handling this error more gracefully.

Copy link
Contributor

@SeanHealy33 SeanHealy33 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@jonnyom jonnyom merged commit d315c40 into master Mar 26, 2019
@jonnyom jonnyom deleted the jonny/add_invalid_document_error branch March 26, 2019 11:22
@sidonath
Copy link
Contributor

sidonath commented Apr 1, 2019

We started getting undefined method '[]' for nil:NilClass at lib/intercom/request.rb:114 after upgrading to 3.7.5 and it seems as this PR could be addressing the problem.

However, it's hard to be certain as I have no idea what hides between nil, since line 113 is a little bit misleading, as it doesn't always raise in case of a failure:

raise_errors_on_failure(response) if parsed_body.nil?

Maybe raise_errors_on_failure should raise for every response with code >= 400 or at least log the error somehow?

@jonnyom
Copy link
Contributor Author

jonnyom commented Jul 15, 2019

Hey @sidonath I think this PR wasn't actually added in 3.7.5, but rather 3.7.6

Sorry for the delay in getting back to you, this fell through the cracks.

@sidonath
Copy link
Contributor

Hi @jonnyom! I've since realized that the issue was unrelated to these changes and opened #467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants