Make soft exceptions easier to spot in logcat (#44958)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/44958

Now, all soft exception methods will have raiseSoftException(...)

## Before

```
BridgelessReact: ReactHost{0}.getOrCreateDestroyTask(): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```

## After
```
BridgelessReact: ReactHost{0}.raiseSoftException(getOrCreateDestroyTask()): handleHostException(message = "Unable to load script. Make sure you're either running Metro (run 'npx react-native start') or that your bundle 'RNTesterBundle.js' is packaged correctly for release.")
```

Changelog: [Internal]

Reviewed By: alanleedev

Differential Revision: D58593609

fbshipit-source-id: 171a872cd41e4ffe9c2e9654c563a6f3af342ad9
This commit is contained in:
Ramanpreet Nara
2024-06-14 16:32:34 -07:00
committed by Facebook GitHub Bot
parent 457d14bd1b
commit ce2e4263bd
@@ -903,11 +903,13 @@ public class ReactHostImpl implements ReactHost {
setCurrentActivity(null);
}
private void raiseSoftException(String method, String message) {
raiseSoftException(method, message, null);
private void raiseSoftException(String callingMethod, String message) {
raiseSoftException(callingMethod, message, null);
}
private void raiseSoftException(String method, String message, @Nullable Throwable throwable) {
private void raiseSoftException(
String callingMethod, String message, @Nullable Throwable throwable) {
final String method = "raiseSoftException(" + callingMethod + ")";
log(method, message);
if (throwable != null) {
ReactSoftExceptionLogger.logSoftException(