Skip to content

fix : added proper error handling to failure logs #42

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

Merged
merged 6 commits into from
May 21, 2025

Conversation

tech-sushant
Copy link
Contributor

Fixed an issue where an error in fetching one type of logs was disrupting the retrieval of all log types.

@@ -64,16 +73,17 @@ export async function retrieveSessionFailures(
},
});

await assertOkResponse(response, "session logs");
const validationResult = validateLogResponse(response, "session logs");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
const validationResult = validateLogResponse(response, "session logs");
const validationError = validateLogResponse(response, "session logs");

do this in all places

logs.length > 0
? `Network Failures (${logs.length} found):\n${JSON.stringify(logs, null, 2)}`
: "No network failures found",
response.message ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

directly return the result of these conditionals in the response (for other methods as well)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you explain this change a bit ?

pulkitsharma07
pulkitsharma07 previously approved these changes May 20, 2025
@pulkitsharma07
Copy link
Collaborator

tests failed

@tech-sushant
Copy link
Contributor Author

Please check now

@pulkitsharma07 pulkitsharma07 merged commit b376a26 into browserstack:main May 21, 2025
1 check passed
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