-
Notifications
You must be signed in to change notification settings - Fork 9
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
Conversation
lib/vbms/service/paged_documents.rb
Outdated
@@ -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? |
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.
agreed with your thought: let's have a specific error subclass ZeroPagesError
here so that callers can decide what to do.
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.
Done!
Rebased. |
cc7fbd7
to
95b90bd
Compare
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.
lgtm!
### 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
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
?)