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 {
2424 * @param errorObject Error object to be sent to Instabug's servers
2525 */
2626 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 ) ;
2838 var jsonObject = {
2939 message : errorObject . name + ' - ' + errorObject . message ,
3040 os : Platform . OS ,
You can’t perform that action at this time.
0 commit comments