sarriaroman / FabricPlugin

Fabric.io plugin for Cordova or Phonegap
MIT License
198 stars 159 forks source link

Bug in the code on fabricplugin.crashlytics.js on line 37 #139

Open Thomasbehan opened 5 years ago

Thomasbehan commented 5 years ago

TypeError: trace[Symbol.iterator] is not a function at FabricCrashlytics.sendNonFatalCrash (FabricPlugin.Crashlytics.js:37)

uniphonic commented 5 years ago

I too am seeing an issue with .sendNonFatalCrash , but I'm not seeing that error message. Can you give any steps to reproduce it? Also, what platform are you seeing this on?

Thomasbehan commented 5 years ago

I got around this because im using angularjs i was able to setup stacktrace.js in a way that i could process the stacktrace.js responses to get the expected stack. my main reason for this is wanting crashlytics to group different errors based off the stacktrace rather than reporting line 120 of the fabricplugin.js file everytime allows for better tracking of individual issues i also log before throwing an error which can provide more context as to what the user was trying to do.

I just think that this should be documented in this plugin or a function in the plugin could do the processing of the stacktrace.js function if its not the expected stack

vendramini commented 5 years ago

@Thomasbehan how did you fix?

Thomasbehan commented 5 years ago

use stacktrace.js to process your errors then send them to fabric/firebase https://www.stacktracejs.com/

vendramini commented 5 years ago

In my case, I'm using with ionic/cordova to build an app. When I try to get user's current location and for some reason there's an error, I just call window['fabric'].Crashlytics.sendNonFatalCrash("GPS error", error); where the parameter error came from a promise .catch(error).

I can't figure out what's happening.

Thomasbehan commented 5 years ago

ah i see so in your case youll need to npm install stacktracejs or a similar library and run the following code

StackTrace.fromError(error).then(function (stackframes) { window['fabric'].Crashlytics.sendNonFatalCrash("GPS error", stackframes); });

the plugin needs a stacktrace to work properly

vendramini commented 5 years ago

I'll try it next week, then I come back here to tell if everything went well.

Thank you.