recordException method

  1. @override
void recordException(
  1. dynamic exception, {
  2. StackTrace? stackTrace,
})
override

Record metadata about an exception occurring during this span.

Implementation

@override
void recordException(dynamic exception, {StackTrace? stackTrace}) {
  // ignore: todo
  // TODO: O11Y-1531: Consider integration of Events here.
  setAttributes([
    api.Attribute.fromString(api.SemanticAttributes.exceptionType,
        exception.runtimeType.toString()),
    api.Attribute.fromString(
        api.SemanticAttributes.exceptionMessage, exception.toString()),
    api.Attribute.fromString(
        api.SemanticAttributes.exceptionStacktrace, stackTrace.toString()),
  ]);
}