trackErrorWithException method

  1. @override
void trackErrorWithException(
  1. String source,
  2. dynamic e, [
  3. StackTrace? stackTrace
])
override

Track an error specifying its source, with exception e and optional stackTrace.

Implementation

@override
void trackErrorWithException(String source, dynamic e, [StackTrace? stackTrace])
async
{
    logInfo((_isEnabled ? 'GoogleAnalytics' : 'Disabled-GoogleAnalytics') + ': trackErrorWithException: $source / $e / $stackTrace');

    if (_isEnabled)
    {
        Map<String, dynamic> params =
        {
            'Message': e.toString(),
            'StackTrace': getOrCreateStackTrace(stackTrace)
        };

        track('Error', params);
    }
}