From d9a5e415cdc7732ffad0c426aa4776519c869539 Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Mon, 24 Nov 2025 07:43:53 -0500 Subject: [PATCH] task: Capture bridge message decoding failure details There are infrequent fatal errors reported to the observability platform. The error reports contain very little details. This is an effort to uncover the origin of the failures. --- .../Sources/EditorViewController.swift | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift index e2af6fe4..795ce516 100644 --- a/ios/Sources/GutenbergKit/Sources/EditorViewController.swift +++ b/ios/Sources/GutenbergKit/Sources/EditorViewController.swift @@ -475,7 +475,22 @@ public final class EditorViewController: UIViewController, GutenbergEditorContro delegate?.editor(self, didLogMessage: log.message, level: log.level) } } catch { - fatalError("failed to decode message: \(error)") + // Capture detailed diagnostic information for crash reporting + let messageType = message.type + let messageBodyDescription = String(describing: message.body) + + let errorMessage = """ + Failed to decode editor message: + - Message type: \(messageType) + - Decode error: \(error) + - Message body: \(messageBodyDescription) + """ + + NSLog("❌ GutenbergKit Message Decode Error: %@", errorMessage) + + assertionFailure(errorMessage) + + fatalError(errorMessage) } }