Skip to content

Commit

Permalink
Automatically collect throwables from C#
Browse files Browse the repository at this point in the history
  • Loading branch information
vijaysharm committed May 14, 2020
1 parent cdb3944 commit f8e9407
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Plugins/TestFairy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ public static void setServerEndpoint(string endpoint)

public static void begin(string APIKey)
{
TestFairy.installUnityCrashHandler();
TestFairy_begin(APIKey);
}

Expand Down Expand Up @@ -463,6 +464,7 @@ public static void begin(string APIKey)
activityContext = activityClass.GetStatic<AndroidJavaObject>("currentActivity");
}

TestFairy.installUnityCrashHandler();
TestFairy.callMethod("begin", activityContext, APIKey);
}

Expand Down Expand Up @@ -567,6 +569,14 @@ public static bool setAttribute(string aKey, string aValue) {
return false;
}
#endif
private static void installUnityCrashHandler() {
Application.logMessageReceivedThreaded += TestFairy.logMsgRecvThreaded;
}

private static void logMsgRecvThreaded(string _condition, string _stackTrace, LogType _type) {
if (_type==LogType.Exception) {
TestFairy.logException(_condition, _stackTrace);
}
}
}
}

0 comments on commit f8e9407

Please sign in to comment.