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

Raise error on empty paged responses #252

Merged
merged 2 commits into from
Mar 5, 2020
Merged

Conversation

nanotone
Copy link
Contributor

@nanotone nanotone commented Mar 4, 2020

Connects #251

This appears to be the first instance of connect_vbms raising an error for a request/response that's valid at the HTTP and SOAP levels. I wasn't sure if it's better to just raise a ClientError, or to raise an instance of a subclass (PagingError?)

@nanotone nanotone requested a review from pkarman March 4, 2020 21:57
@@ -11,6 +11,9 @@ def call(file_number:)
req = next_request(file_number, 0)
first_page = client.send_request(req)

# interpret a first page with no sections (and no doc count) as equivalent to zero pages.
raise ClientError.new("No sections found in first page") if first_page.empty?
Copy link
Contributor

Choose a reason for hiding this comment

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

agreed with your thought: let's have a specific error subclass ZeroPagesError here so that callers can decide what to do.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

@nanotone
Copy link
Contributor Author

nanotone commented Mar 5, 2020

CI is blocked on #253

Rebased.

@nanotone nanotone force-pushed the nanotone/empty-page-exception branch from cc7fbd7 to 95b90bd Compare March 5, 2020 16:30
Copy link
Contributor

@pkarman pkarman left a comment

Choose a reason for hiding this comment

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

lgtm!

@nanotone nanotone merged commit f374da6 into master Mar 5, 2020
va-bot pushed a commit to department-of-veterans-affairs/caseflow that referenced this pull request Mar 6, 2020
### Description
Upgrade to latest `connect_vbms` git hash to get these goodies:

department-of-veterans-affairs/connect_vbms#250 - fix pagination bug when VBMS returns fewer documents than reported

department-of-veterans-affairs/connect_vbms#252 - handle VBMS returning no pages at all

department-of-veterans-affairs/connect_vbms#253 - fix small security warning in Rake
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.

2 participants