首页 > 解决方案 > How to create Exception instance in C#?

问题描述

I'm upgrading Crashlytics sdk from Fabric to Firebase for Unity3d project and trying to adapt api-changing for exceptions catching.

I need to construct Exception instance from next arguments:

void OnLogMessageReceived(String log, String stackTrace, LogType type)

Now I have

Crashlytics.Log(log);
Crashlytics.Log(stackTrace);

Exception exception = new Exception(type);
Crashlytics.LogException(exception);

Is it possible to send stackTrace and get it pretty structured like it was in Fabric?

标签: c#firebaseerror-handlingsdkcrashlytics

解决方案


This is Zubair from Fabric/Firebase. With the release of Firebase Crashlytics for Unity, Developers already using the Fabric Crashlytics SDK might need to make some minor changes to their code when upgrading to Firebase Crashlytics. This guide will provide details on the specific changes to the API, the reason for the change, and helpful suggestions where workarounds are required.


推荐阅读