diff --git a/webf/lib/src/launcher/launcher_nezha.dart b/webf/lib/src/launcher/launcher_nezha.dart index 685343fce..42dfa3aa3 100644 --- a/webf/lib/src/launcher/launcher_nezha.dart +++ b/webf/lib/src/launcher/launcher_nezha.dart @@ -274,10 +274,10 @@ class _MainPageState extends State bundle: bundle, controller: preloadController, onLoadError: (FlutterError error, StackTrace stackTrace) { - _showErrorPage(NEZ_ERR_CODE_BUNDLE_LOAD, '$error, $stackTrace'); + _reportError(NEZ_ERR_CODE_BUNDLE_LOAD, '$error, $stackTrace'); }, onJSError: (String message) { - _showErrorPage(NEZ_ERR_CODE_JS_EVALUATE, message); + _reportError(NEZ_ERR_CODE_JS_EVALUATE, message); }, onDOMContentLoaded: (controller) async { TimeMeasure.log('onDOMContentLoaded, $controller'); @@ -364,9 +364,9 @@ class _MainPageState extends State return _cacheBundle!; } - void _showErrorPage(String errCode, String message) { + void _reportError(String errCode, String message) { TimeMeasure.log('$errCode, $message'); - NezhaBirdgeModule.invokeMethod(uniqueId, NEZ_BRIDGE_SHOW_ERROR_PAGE, { + NezhaBirdgeModule.invokeMethod(uniqueId, NEZ_BRIDGE_REPORT_ERR, { 'code': errCode, 'message': message }); diff --git a/webf/lib/src/nezha/nezha_bridge_module.dart b/webf/lib/src/nezha/nezha_bridge_module.dart index 8d5ce3fb9..c04c44734 100644 --- a/webf/lib/src/nezha/nezha_bridge_module.dart +++ b/webf/lib/src/nezha/nezha_bridge_module.dart @@ -6,7 +6,7 @@ const String NEZ_BRIDGE_UUID = 'nez.bridge.uuid'; const String NEZ_BRIDGE_GET_TEMP_DIR = 'getTemporaryDirectory'; const String NEZ_BRIDGE_GET_BUNDLE = 'getBundle'; -const String NEZ_BRIDGE_SHOW_ERROR_PAGE = 'showErrorPage'; +const String NEZ_BRIDGE_REPORT_ERR = 'reportError'; const String NEZ_ERR_CODE_JS_EVALUATE = '603601';