feat(android): report full native stack trace on error (#4651)
This commit is contained in:
@@ -140,6 +140,22 @@ class VideoEventEmitter {
|
||||
putString("errorException", exception.toString())
|
||||
putString("errorCode", errorCode)
|
||||
putString("errorStackTrace", stackTrace)
|
||||
|
||||
// https://github.com/facebook/react-native/blob/v0.80.2/packages/react-native/ReactCommon/react/nativemodule/core/platform/android/ReactCommon/JavaTurboModule.cpp#L465
|
||||
putMap("cause", Arguments.createMap().apply {
|
||||
putString("name", exception.javaClass.simpleName)
|
||||
exception.message?.let { putString("message", it) }
|
||||
putArray("stackElements", Arguments.createArray().apply {
|
||||
exception.stackTrace.forEach { element ->
|
||||
pushMap(Arguments.createMap().apply {
|
||||
putString("className", element.className)
|
||||
putString("fileName", element.fileName)
|
||||
putInt("lineNumber", element.lineNumber)
|
||||
putString("methodName", element.methodName)
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
@@ -298,6 +298,7 @@ export type OnVideoErrorData = Readonly<{
|
||||
localizedRecoverySuggestion?: string; // ios
|
||||
domain?: string; // ios
|
||||
}>;
|
||||
cause?: object; // React Native convertThrowableToJSError/convertNSExceptionToJSError
|
||||
target?: Int32; // ios
|
||||
}>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user