Skip to content

Commit

Permalink
Merge pull request #760 from prebid/668-incorrect-fetch-demand-result…
Browse files Browse the repository at this point in the history
…-when-internet-connection-is-not-available

Return error if FetchDemandResult Contains "no internet"
  • Loading branch information
jsligh authored Jun 10, 2024
2 parents c427d84 + 6f36206 commit f414df5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static FetchDemandResult parseErrorMessage(String msg) {
if (msg.contains("Timeout")) {
return TIMEOUT;
}
if (msg.contains("Network Error")) {
if (msg.contains("Network Error") || msg.contains("No internet")) {
return NETWORK_ERROR;
}
if (requestMatcher.find() || msg.contains("No stored request")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ public void whenParseErrorMessageAndNetworkErrorMsg_NetworkErrorResult() {
assertEquals(NETWORK_ERROR, FetchDemandResult.parseErrorMessage("Network Error"));
}

@Test
public void whenParseErrorMessageAndNetworkErrorMsg_NoInternetNetworkErrorResult() {
assertEquals(NETWORK_ERROR, FetchDemandResult.parseErrorMessage("SDK internal error: Invalid bid response: Initialization failed: No internet connection detected"));
}

@Test
public void whenParseErrorMessageAndInvalidAccountMsg_InvalidAccountIdResult() {
assertEquals(INVALID_ACCOUNT_ID, FetchDemandResult.parseErrorMessage("Invalid request: Stored Request with ID=\"0689a263-318d-448b-a3d4-b02e8a709d9da\" not found."));
Expand Down

0 comments on commit f414df5

Please sign in to comment.