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

chore: add safety around start() in EventSource #166

Merged
merged 1 commit into from
Aug 11, 2023

Conversation

L-Joli
Copy link
Contributor

@L-Joli L-Joli commented Aug 11, 2023

  • add safety around start() in EventSource to catch exception

@L-Joli L-Joli requested a review from a team August 11, 2023 14:00
DevCycleLogger.i("Starting EventSource client using URI: %s", url);

streamExecutor.execute(() -> {
try {
Copy link
Contributor

Choose a reason for hiding this comment

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

are both of these try catches necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

hmmm...I'm thinking they could catch more specific exceptions like if the executor rejects the task (RejectedExecutionException) and general Exception during run(). Do you think I should only keep one? Also, should I actually log the entire exception instead of just the message?🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

couldn't you catch general exceptions at the top level and log based on the type?

@L-Joli L-Joli force-pushed the DVC-8476-crashes-investigation branch from 4280ec9 to 20b97ab Compare August 11, 2023 15:18
@L-Joli L-Joli requested a review from jsalaber August 11, 2023 15:19
@L-Joli L-Joli enabled auto-merge (squash) August 11, 2023 15:25
@L-Joli L-Joli merged commit 76c9e75 into main Aug 11, 2023
5 checks passed
@L-Joli L-Joli deleted the DVC-8476-crashes-investigation branch August 11, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants