alexeyinkin commented on code in PR #24338:
URL: https://github.com/apache/beam/pull/24338#discussion_r1031579889
##########
playground/frontend/lib/modules/messages/handlers/set_content_message_handler.dart:
##########
@@ -34,11 +37,21 @@ class SetContentMessageHandler extends
AbstractMessageHandler {
return MessageHandleResult.notHandled;
}
- _handle(message);
+ unawaited(_handle(message));
return MessageHandleResult.handled;
}
- void _handle(SetContentMessage message) {
- playgroundController.examplesLoader.load(message.descriptor);
+ Future<void> _handle(SetContentMessage message) async {
+ final descriptor = message.descriptor;
+
+ try {
+ await playgroundController.examplesLoader.load(descriptor);
+ } on Exception catch (ex) {
+ PlaygroundComponents.toastNotifier.addException(ex);
Review Comment:
`ExamplesLoader` is in `playground_components` package shared by Playground
and Tour of Beam. This package allows for toasts but should not itself create
ones because it will be hard to suppress them if Tour of Beam will ever require
silent failures or its custom errors.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]