diff --git a/packages/snaps-controllers/src/snaps/SnapController.ts b/packages/snaps-controllers/src/snaps/SnapController.ts index 80ea54e4a0..982c2bfbfc 100644 --- a/packages/snaps-controllers/src/snaps/SnapController.ts +++ b/packages/snaps-controllers/src/snaps/SnapController.ts @@ -1507,7 +1507,10 @@ export class SnapController extends BaseController< ); } - _onUnhandledSnapError(snapId: string, _error: SnapErrorJson) { + _onUnhandledSnapError(snapId: string, error: SnapErrorJson) { + // Log the error that caused the crash + // so it gets raised to the developer for debugging purposes. + logError(`Unhandled error from "${snapId}":`, error); this.stopSnap(snapId as SnapId, SnapStatusEvents.Crash).catch( (stopSnapError) => { // TODO: Decide how to handle errors.