From aa7bf1c019dc1eb7498e4a63f077c6cff6b5ec10 Mon Sep 17 00:00:00 2001 From: Hossam Hassan Date: Wed, 1 Feb 2017 01:36:20 +0200 Subject: [PATCH] Drop assign default value for parameters --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 490834f..c3b7ae2 100644 --- a/index.js +++ b/index.js @@ -464,11 +464,14 @@ module.exports = { Instabug.isInstabugNotification(dict, isInstabugNotificationCallback); }, - reportJsException: function (error, errorIdentifier = undefined) { + reportJsException: function (error, errorIdentifier) { + if (!error || !error instanceof Error) + throw new Error("You should pass an error object"); + let jsStackTrace = instabugParser(error); - if (errorIdentifier instanceof undefined && error instanceof Error) + if (!errorIdentifier) Instabug.reportJsException(jsStackTrace, error.message, null); - else if (errorIdentifier != null && error instanceof Error) { + else if (errorIdentifier) { Instabug.reportJsException(jsStackTrace, error.message, errorIdentifier); } },