From 46dbdd7136f1c12b0644f1cd8f791ebefa3b1b83 Mon Sep 17 00:00:00 2001 From: Hossam Hassan Date: Wed, 1 Feb 2017 01:00:40 +0200 Subject: [PATCH] Use the correct variable names and import the missing package --- .../instabug/reactlibrary/RNInstabugReactnativeModule.java | 7 +++++-- index.js | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java index f6d6919..35f39ea 100644 --- a/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java +++ b/android/src/main/java/com/instabug/reactlibrary/RNInstabugReactnativeModule.java @@ -6,6 +6,9 @@ import android.net.Uri; import com.facebook.react.bridge.ReactApplicationContext; import com.facebook.react.bridge.ReactContextBaseJavaModule; import com.facebook.react.bridge.ReactMethod; +import com.facebook.react.bridge.ReadableArray; +import com.facebook.react.bridge.ReadableMap; + import com.instabug.library.Instabug; import com.instabug.library.internal.module.InstabugLocale; import com.instabug.library.invocation.InstabugInvocationEvent; @@ -436,7 +439,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { * @param throwable the exception to be reported */ @ReactMethod - public void reportJsException(ReadableArray stackTraceArray, String message, String errorIdentifier) { + public void reportJsException(ReadableArray stack, String message, String errorIdentifier) { try { int size = stack != null ? stack.size() : 0; StackTraceElement[] stackTraceElements = new StackTraceElement[size]; @@ -449,7 +452,7 @@ public class RNInstabugReactnativeModule extends ReactContextBaseJavaModule { stackTraceElements[i] = new StackTraceElement(fileName, methodName, fileName, lineNumber); } Throwable throwable = new Throwable(message); - throwable.setStacktrace(stackTraceElements); + throwable.setStackTrace(stackTraceElements); if (errorIdentifier != null) mInstabug.reportException(throwable); else diff --git a/index.js b/index.js index 88fc2ad..490834f 100644 --- a/index.js +++ b/index.js @@ -466,9 +466,9 @@ module.exports = { reportJsException: function (error, errorIdentifier = undefined) { let jsStackTrace = instabugParser(error); - if (message instanceof undefined && error instanceof Error) + if (errorIdentifier instanceof undefined && error instanceof Error) Instabug.reportJsException(jsStackTrace, error.message, null); - else if (message != null && error instanceof Error) { + else if (errorIdentifier != null && error instanceof Error) { Instabug.reportJsException(jsStackTrace, error.message, errorIdentifier); } },