addError method

void addError(
  1. Object error,
  2. RumErrorSource source, {
  3. StackTrace? stackTrace,
  4. String? errorType,
  5. Map<String, Object?> attributes = const {},
})

Notifies that the Exception or Error error occurred in currently presented View, with an origin of source. You can optionally set additional attributes for this error, an errorType and a stackTrace

Implementation

void addError(
  Object error,
  RumErrorSource source, {
  StackTrace? stackTrace,
  String? errorType,
  Map<String, Object?> attributes = const {},
}) {
  wrap('rum.addError', logger, attributes, () {
    return _platform.addError(error, source, stackTrace, errorType, {
      DatadogPlatformAttributeKey.errorSourceType: 'flutter',
      ...attributes
    });
  });
}