-
Notifications
You must be signed in to change notification settings - Fork 12
ToBF 28.03 fixes #446
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
ToBF 28.03 fixes #446
Conversation
playground/frontend/playground_components/lib/src/cache/example_cache.dart
Show resolved
Hide resolved
|
|
||
| // ignore: avoid_catches_without_on_clauses | ||
| } catch (ex, trace) { | ||
| } catch (_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way we lose details of the first exception when loading a precompiled object and only report the exception of loading a snippet. So far we do not use those details anyway and only report "Error loading example" but I do not like losing it.
Options are:
- Synthesize an exception to contain multiple exceptions, throw it here.
- Add both exceptions to
ToastNotifierhere. I do not like this because it mixes responsibilities.
Or we can just add a TODO to preserve both exceptions later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From completeError doc:
Calling [complete] or [completeError] must be done at most once.
Can exception and stackTrace be passed as arguments into _tryLoadSharedExample?
| _completer.complete(example); | ||
| } on Exception catch (ex, trace) { | ||
| _completer.completeError(ex, trace); | ||
| return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I delete this return? @alexeyinkin
|
|
||
| class MultipleExceptions implements Exception { | ||
| final List<Exception> exceptions; | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add traces, they can also be useful.
| exampleCache.loadExampleInfo(example), | ||
| await exampleCache.loadExampleInfo(exampleBase), | ||
| ); | ||
| } on Exception catch (loadPrecompiledExampleException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| } on Exception catch (loadPrecompiledExampleException) { | |
| } on Exception catch (ex, trace) { |
No need for long names for local variables.
| _completer.completeError(ex, trace); | ||
| return; | ||
| Future<void> _tryLoadSharedExample({ | ||
| required Exception previousException, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A list was a better idea because that way the order of attempts can be changed easier.
alexeyinkin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (Internal review).
Refinement of the tobf-all-tasks-28-03-23 branch.
Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:
addresses #123), if applicable. This will automatically add a link to the pull request in the issue. If you would like the issue to automatically close on merging the pull request, commentfixes #<ISSUE NUMBER>instead.CHANGES.mdwith noteworthy changes.See the Contributor Guide for more tips on how to make review process smoother.
To check the build health, please visit https://github.com/apache/beam/blob/master/.test-infra/BUILD_STATUS.md
GitHub Actions Tests Status (on master branch)
See CI.md for more information about GitHub Actions CI.