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

core: do not emit NOT_HTML error if record not ok #15271

Merged
merged 1 commit into from
Jul 17, 2023

Conversation

connorjclark
Copy link
Collaborator

ref #15270

@@ -95,6 +95,9 @@ function getNonHtmlError(finalRecord) {
// If we never requested a document, there's no doctype error, let other cases handle it.
if (!finalRecord) return undefined;

// If the document request error'd, we should not complain about a bad mimeType.
if (!finalRecord.mimeType || finalRecord.statusCode === -1) return undefined;
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't we emit a different error in this case instead of returning no error?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

So ideally when this occurs, the networkError would be what getPageLoadError returns.

For some reason in LR that wasn't happening. The mainRecord (redirected) failed, yet we didn't emit a network error type.

The fallback in this case is a generic navigationError. So in isolation, this function returning nothing when there is no mimeType-specific error is consistent with the error pattern used here.

@connorjclark connorjclark merged commit 61f2972 into main Jul 17, 2023
24 checks passed
@connorjclark connorjclark deleted the nav-mime-record-ok branch July 17, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants