-
-
Notifications
You must be signed in to change notification settings - Fork 75
Open
Labels
enhancementNew feature or requestNew feature or requestkotlinIssue regarding the Kotlin part of Nitro/NitrogenIssue regarding the Kotlin part of Nitro/Nitrogen
Description
Feature Request/Enhancement
Hello again!
I find that if I throw a Error in Kotlin and catch it in js, the js error.message has the name and stacktrace of that kotlin error, which is not same as Swift.
It would be better to remove these useless info to keep error.message clean.
override fun doSomething(): Promise<String?> {
return Promise.rejected(Error("Failed"))
}and in js log its message
try {
await doSomething();
} catch (error) {
console.log(error.message);
}and the log looks like
java.lang.Error: Failed
at com.margelo.nitro.deviceinfo.DeviceInfo.doSomething(DeviceInfo.kt:120)
at com.facebook.jni.NativeRunnable.run(Native Method)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.kt:21)
at android.os.Looper.loopOnce(Looper.java:222)
at android.os.Looper.loop(Looper.java:314)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.startNewBackgroundThread$lambda$1(MessageQueueThreadImpl.kt:175)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion.$r8$lambda$ldnZnqelhYFctGaUKkOKYj5rxo4(Unknown Source:0)
at com.facebook.react.bridge.queue.MessageQueueThreadImpl$Companion$$ExternalSyntheticLambda0.run(D8$$SyntheticClass:0)
at java.lang.Thread.run(Thread.java:1012)
Are there any existing workarounds?
No response
Additional information
- I checked the documentation and couldn't find this feature.
- I can create a PR to implement this feature. (See Contributing for more information)
- I searched for similar issues in this repository and found none.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestkotlinIssue regarding the Kotlin part of Nitro/NitrogenIssue regarding the Kotlin part of Nitro/Nitrogen