-
Notifications
You must be signed in to change notification settings - Fork 3
task: Log plugin load and editor initialization failures #249
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
base: trunk
Are you sure you want to change the base?
Conversation
Logging these exceptions will improve the ability to act upon them and improve stability.
Ensure early logs are evaluated correctly.
The native host parsing expects the `stacktrace` value to be set, otherwise it discards the entire exception.
| setUpGlobalErrorHandlers(); | ||
| setBodyClasses(); | ||
| await awaitGBKitGlobal(); | ||
| setLogLevelFromGBKit(); |
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.
Hoisted from src/utils/editor.jsx to ensure messages from editor initialization log.
| logException( err, { | ||
| isHandled: true, | ||
| handledBy: 'loadPluginsIfEnabled', | ||
| } ); |
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.
Improve observability of plugin loading failures.
| logException( err, { | ||
| isHandled: true, | ||
| handledBy: 'setUpEditorEnvironment', | ||
| } ); |
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.
Improve observability of editor initialization failures.
| if ( stacktrace.length ) { | ||
| exception.stacktrace = stacktrace; | ||
| } | ||
| exception.stacktrace = parseStacktrace( originalException ); |
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.
Always set the stacktrace to avoid native hosts discarding logged exceptions—e.g., ios/Sources/GutenbergKit/Sources/EditorViewControllerDelegate.swift.
E.g., if fetchEditorAssets throws due to an error from the native host, the error object will have an empty stack trace in the JavaScript runtime.
What?
Log exceptions from failed plugin loading and editor initialization.
Why?
Ref CMM-887. Improve failure observability.
How?
stacktracevalue for exceptions sent across the bridge.Testing Instructions
ios/Demo-iOS/Sources/Views/EditorView.swift:163.Accessibility Testing Instructions
N/A, no user-facing changes.
Screenshots or screencast
N/A, no user-facing changes.