@@ -220,7 +220,7 @@ public void run() {
220
220
}
221
221
222
222
/**
223
- * Send Apm network log by Reflection
223
+ * Send Apm network log by Reflection
224
224
*/
225
225
@ ReactMethod
226
226
public void networkLog (String networkData ) throws JSONException {
@@ -242,8 +242,8 @@ public void networkLog(String networkData) throws JSONException {
242
242
final Integer statusCode = (Integer ) jsonObject .get ("responseCode" );
243
243
final long requestDuration = ((Number ) jsonObject .get ("duration" )).longValue ();
244
244
final long requestStartTime = ((Number ) jsonObject .get ("startTime" )).longValue () * 1000 ;
245
- final String requestHeaders = (String ) jsonObject .get ("requestHeaders" ).toString ();
246
- final String responseHeaders = (String ) jsonObject .get ("responseHeaders" ).toString ();
245
+ final String requestHeaders = (String ) jsonObject .get ("requestHeaders" ).toString ();
246
+ final String responseHeaders = (String ) jsonObject .get ("responseHeaders" ).toString ();
247
247
final String errorMessage ;
248
248
if (errorDomain .equals ("" )) {
249
249
errorMessage = null ;
@@ -254,25 +254,21 @@ public void networkLog(String networkData) throws JSONException {
254
254
String gqlQueryName = null ;
255
255
if (jsonObject .has ("gqlQueryName" )){
256
256
gqlQueryName = (String ) jsonObject .get ("gqlQueryName" );
257
- }
257
+ }
258
258
final String serverErrorMessage = (String ) jsonObject .get ("serverErrorMessage" );
259
-
259
+
260
260
try {
261
261
Method method = getMethod (Class .forName ("com.instabug.apm.networking.APMNetworkLogger" ), "log" , long .class , long .class , String .class , String .class , long .class , String .class , String .class , String .class , String .class , String .class , long .class , int .class , String .class , String .class , String .class , String .class );
262
262
if (method != null ) {
263
263
method .invoke (apmNetworkLogger , requestStartTime , requestDuration , requestHeaders , requestBody , requestBodySize , requestMethod , requestUrl , requestContentType , responseHeaders , responseBody , responseBodySize , statusCode , responseContentType , errorMessage , gqlQueryName , serverErrorMessage );
264
264
} else {
265
265
Log .e ("IB-CP-Bridge" , "apmNetworkLogByReflection was not found by reflection" );
266
266
}
267
- } catch (ClassNotFoundException e ) {
268
- e .printStackTrace ();
269
- } catch (IllegalAccessException e ) {
270
- e .printStackTrace ();
271
- } catch (InvocationTargetException e ) {
267
+ } catch (Throwable e ) {
272
268
e .printStackTrace ();
273
269
}
274
270
}
275
- catch (Exception e ) {
271
+ catch (Throwable e ) {
276
272
e .printStackTrace ();
277
273
}
278
274
}
0 commit comments