diff --git a/lib/web_ui/lib/src/engine/clipboard.dart b/lib/web_ui/lib/src/engine/clipboard.dart index f5b162ac7bfa3..251b85650fd75 100644 --- a/lib/web_ui/lib/src/engine/clipboard.dart +++ b/lib/web_ui/lib/src/engine/clipboard.dart @@ -186,8 +186,6 @@ class ExecCommandPasteStrategy implements PasteFromClipboardStrategy { @override Future getData() { // TODO(nurhan): https://github.com/flutter/flutter/issues/48581 - // TODO(nurhan): https://github.com/flutter/flutter/issues/48580 - print('Paste is not implemented for this browser.'); - throw UnimplementedError(); + throw UnimplementedError('Paste is not implemented for this browser.'); } } diff --git a/lib/web_ui/lib/src/engine/html/surface.dart b/lib/web_ui/lib/src/engine/html/surface.dart index 546e69384745f..f6b3ffe5fa893 100644 --- a/lib/web_ui/lib/src/engine/html/surface.dart +++ b/lib/web_ui/lib/src/engine/html/surface.dart @@ -347,16 +347,16 @@ abstract class PersistedSurface implements ui.EngineLayer { /// such as on the very first frame. @mustCallSuper void build() { - if (rootElement != null) { - try { - throw ''; - } catch (_, stack) { - print( - 'Attempted to build a $runtimeType, but it already has an HTML element ${rootElement!.tagName}.'); - print(stack.toString().split('\n').take(20).join('\n')); + if (assertionsEnabled) { + final html.Element? existingElement = rootElement; + if (existingElement != null) { + throw PersistedSurfaceException( + this, + 'Attempted to build a $runtimeType, but it already has an HTML ' + 'element ${existingElement.tagName}.', + ); } } - assert(rootElement == null); assert(debugAssertSurfaceState(this, PersistedSurfaceState.created)); rootElement = createElement(); assert(rootElement != null);