Skip to content

Commit

Permalink
Merge pull request #58 from fe/nezha/1_75_0-report-err
Browse files Browse the repository at this point in the history
[fix][NEZ][1.75.0] rename showErrorPage to reportError
  • Loading branch information
edmond-l-20230331 authored and GitHub Enterprise committed Nov 21, 2023
2 parents 813912d + 7ed04b2 commit 47e2b97
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions webf/lib/src/launcher/launcher_nezha.dart
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,10 @@ class _MainPageState extends State<MainPage>
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');
Expand Down Expand Up @@ -364,9 +364,9 @@ class _MainPageState extends State<MainPage>
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
});
Expand Down
2 changes: 1 addition & 1 deletion webf/lib/src/nezha/nezha_bridge_module.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down

0 comments on commit 47e2b97

Please sign in to comment.