File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,17 @@ export default {
24
24
* @param errorObject Error object to be sent to Instabug's servers
25
25
*/
26
26
reportJSException : function ( errorObject ) {
27
- let jsStackTrace = InstabugUtils . parseErrorStack ( errorObject ) ;
27
+ let jsStackTrace ;
28
+ if ( Platform . hasOwnProperty ( "constants" ) ) {
29
+ // RN version >= 0.63
30
+ if ( Platform . constants . reactNativeVersion . minor >= 64 )
31
+ // RN version >= 0.64 -> Stacktrace as string
32
+ jsStackTrace = InstabugUtils . parseErrorStack ( errorObject . stack ) ;
33
+ // RN version == 0.63 -> Stacktrace as string
34
+ else jsStackTrace = InstabugUtils . parseErrorStack ( errorObject ) ;
35
+ }
36
+ // RN version < 0.63 -> Stacktrace as string
37
+ else jsStackTrace = InstabugUtils . parseErrorStack ( errorObject ) ;
28
38
var jsonObject = {
29
39
message : errorObject . name + ' - ' + errorObject . message ,
30
40
os : Platform . OS ,
You can’t perform that action at this time.
0 commit comments