From 7d6d0a77356327b4e27c17fce9ec773e70cb0237 Mon Sep 17 00:00:00 2001 From: Ramanpreet Nara Date: Fri, 8 Aug 2025 14:39:42 -0700 Subject: [PATCH] native modules: Show message in redundant rejection redbox (#53152) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/53152 When a redundant reject is called, show the rejection message in the redbox. This can help us pin down the error we need to elminiate in production. Changelog: [Internal] Reviewed By: sanjay-io Differential Revision: D79837541 fbshipit-source-id: 879b5dc42980867051cfab6ccb575304a4a9c4c6 --- .../core/platform/ios/ReactCommon/RCTTurboModule.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm index 2b4dfe8c37f..cb70f355df7 100644 --- a/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm +++ b/packages/react-native/ReactCommon/react/nativemodule/core/platform/ios/ReactCommon/RCTTurboModule.mm @@ -338,12 +338,18 @@ ObjCTurboModule::createPromise(jsi::Runtime &runtime, const std::string &methodN } if (alreadyResolved) { - RCTLogError(@"%s: Tried to reject a promise after it's already been resolved.", moduleMethod.c_str()); + RCTLogError( + @"%s: Tried to reject a promise after it's already been resolved. Message: %s", + moduleMethod.c_str(), + message.UTF8String); return; } if (alreadyRejected) { - RCTLogError(@"%s: Tried to reject a promise more than once.", moduleMethod.c_str()); + RCTLogError( + @"%s: Tried to reject a promise more than once. Message: %s", + moduleMethod.c_str(), + message.UTF8String); return; }