Skip to content

Commit

Permalink
Add log exception handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
jhnstn committed Mar 1, 2024
1 parent 1f30dda commit 43526c5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnEditorAutosaveListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnEditorMountListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGetContentInterrupted;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnDidLogExceptionListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidRequestEmbedFullscreenPreviewListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidRequestUnsupportedBlockFallbackListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidSendButtonPressedActionListener;
Expand Down Expand Up @@ -100,6 +101,7 @@ public void attachToContainer(ViewGroup viewGroup, OnMediaLibraryButtonListener
OnToggleRedoButtonListener onToggleRedoButtonListener,
OnConnectionStatusEventListener onConnectionStatusEventListener,
OnBackHandlerEventListener onBackHandlerEventListener,
OnDidLogExceptionListener onDidLogExceptionListener,
boolean isDarkMode) {
mWPAndroidGlueCode.attachToContainer(
viewGroup,
Expand Down Expand Up @@ -127,6 +129,7 @@ public void attachToContainer(ViewGroup viewGroup, OnMediaLibraryButtonListener
onToggleRedoButtonListener,
onConnectionStatusEventListener,
onBackHandlerEventListener,
onDidLogExceptionListener,
isDarkMode);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@
import org.wordpress.android.util.helpers.MediaFile;
import org.wordpress.android.util.helpers.MediaGallery;
import org.wordpress.aztec.IHistoryListener;
import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergBridgeJS2Parent.LogExceptionCallback;
import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergEmbedWebViewActivity;
import org.wordpress.mobile.ReactNativeGutenbergBridge.GutenbergJsException;
import org.wordpress.mobile.WPAndroidGlue.Media;
import org.wordpress.mobile.WPAndroidGlue.MediaOption;
import org.wordpress.mobile.WPAndroidGlue.RequestExecutor;
Expand All @@ -76,6 +78,7 @@
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnEditorMountListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnFocalPointPickerTooltipShownEventListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGetContentInterrupted;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnDidLogExceptionListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidRequestEmbedFullscreenPreviewListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidRequestPreviewListener;
import org.wordpress.mobile.WPAndroidGlue.WPAndroidGlueCode.OnGutenbergDidRequestUnsupportedBlockFallbackListener;
Expand Down Expand Up @@ -603,6 +606,13 @@ public void onGotoCustomerSupportOptions() {
}
},

new OnDidLogExceptionListener() {
@Override public void didLogException(GutenbergJsException exception,
LogExceptionCallback onLogExceptionCallback) {
AppLog.d(T.EDITOR, "Gutenberg JS Exception in GB editor fragment");
onLogExceptionCallback.onLogException(true);
}
},
GutenbergUtils.isDarkMode(getActivity()));

// request dependency injection. Do this after setting min/max dimensions
Expand Down

0 comments on commit 43526c5

Please sign in to comment.