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

feat(pacer): Updates logic to create error message. #1227

Merged
merged 3 commits into from
Oct 31, 2024

Conversation

ERosendo
Copy link
Contributor

@ERosendo ERosendo commented Oct 30, 2024

While debugging another issue in the recap-fetch API, I noticed that our code was incorrectly identifying certain sealed documents on PACER. This led to a misleading error message being added to the fetch queue:

Unable to download PDF. PDF not served as binary data and unable to find iframe src attribute. URL: https://ecf.caed.uscourts.gov/doc1/03319001890, caseid: 300601, magic_num: None. court_id='caed'

To address this issue, I've added a new phrase to the sealed document check logic and refactored the if statement

Here's another example of a sealed document: https://ecf.vawd.uscourts.gov/doc1/19111488805

@ERosendo ERosendo marked this pull request as ready for review October 30, 2024 03:21
@ERosendo
Copy link
Contributor Author

@mlissner I looked at other queues with the same error message to see if there was a common cause. I found these messages that we're not handling properly:

  1. This document is SEALED (https://ecf.ncmd.uscourts.gov/doc1/13313991712)
  2. No matter of public record has been filed (https://ecf.cacd.uscourts.gov/doc1/031112493036)
  3. Cannot locate the case with caseid 602254

The first message is similar to the one we're fixing in this PR, but not exactly the same. I'll update the PR to handle it too.

For the second message, I can also add logic to handle that case in this PR. But what kind of error message should we show in this case?

We already have checks for the third message:

if b"Cannot locate the case with caseid" in r.content:
# This document is from a different docket, but is included in
# this docket. Probably a criminal case with the doppelganger
# bug. Try again, but do so without the pacer_case_id.
# This should work, but will omit the blue header on the PDFs.
r, url = self._query_pdf_download(
None, pacer_doc_id, pacer_magic_num, got_receipt="1"
)

However, we don't currently check if the same error persists after a second attempt to retrieve the PDF. What kind of error message would be most helpful in this situation?

@mlissner
Copy link
Member

I have no idea what "No matter of public record has been filed" means. I guess it means it's sealed? We could just pass the same message through to the user?

For the third error, I guess passing through the original message makes the most sense too?

@johnhawkinson
Copy link
Contributor

johnhawkinson commented Oct 30, 2024

I have no idea what "No matter of public record has been filed" means. I guess it means it's sealed? We could just pass the same message through to the user?

This language is intended to avoid the implication that there is a sealed document behind the link. Maybe it's a deleted document. Maybe it's a document number that has not been used. Maybe it's a document that has been restricted without being sealed (err?). And, of course, maybe it's an FRCP 5.2(c) document (usually "You do not have permission to view this document.")

@mlissner
Copy link
Member

Great, in that case, feels like we should just use that error message too.

- Uses a list of sealed document phrases for more efficient and readable checking.
@ERosendo ERosendo force-pushed the feat-add-new-sealed-document-phrase branch from 02aa830 to 4a611bc Compare October 31, 2024 00:37
@ERosendo ERosendo changed the title feat(pacer): Updates sealed document check feat(pacer): Updates logic to create error message. Oct 31, 2024
@ERosendo
Copy link
Contributor Author

@mlissner Ready for review.

Copy link
Member

@mlissner mlissner left a comment

Choose a reason for hiding this comment

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

OK, now we surely have all the error messages. :)

@mlissner mlissner merged commit ed44c1e into main Oct 31, 2024
12 checks passed
@mlissner mlissner deleted the feat-add-new-sealed-document-phrase branch October 31, 2024 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

3 participants