lib_unity_purchase/Runtime/Purchasing/Telemetry/Diagnostics/TelemetryDiagnostics.cs

27 lines
878 B
C#
Raw Permalink Normal View History

2024-01-29 18:49:33 +08:00
using System;
namespace UnityEngine.Purchasing.Telemetry
{
class TelemetryDiagnostics : ITelemetryDiagnostics
{
readonly ITelemetryDiagnosticsInstanceWrapper m_TelemetryDiagnosticsInstanceWrapper;
public TelemetryDiagnostics(ITelemetryDiagnosticsInstanceWrapper telemetryDiagnosticsInstanceWrapper)
{
m_TelemetryDiagnosticsInstanceWrapper = telemetryDiagnosticsInstanceWrapper;
}
public void SendDiagnostic(string diagnosticName, Exception e)
{
try
{
m_TelemetryDiagnosticsInstanceWrapper.SendDiagnostic(diagnosticName, e.ToString());
}
catch (IapTelemetryException exception)
{
Debug.unityLogger.LogIAPError($"An exception occured while sending a diagnostic: {exception.Message}");
}
}
}
}