NewRelicHttpErrorHandler class

Centralized error handler for HTTP instrumentation

This class provides safe error handling for HTTP stream operations, preventing crashes when streams are cancelled or closed unexpectedly.

Constructors

NewRelicHttpErrorHandler()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isStreamClosureError(dynamic error) bool
Checks if an error is a stream closure error that should be silently handled
safeExecute(void operation(), {bool silenceStreamErrors = true}) → void
Wraps a function execution with safe error handling
safeFuture<T>(Future<T> operation(), {T? fallbackValue, bool rethrowOnError = true}) Future<T>
Safely executes a Future operation with automatic error handling
safeRecordTransaction({required String url, required String method, required int statusCode, required int startTime, required int endTime, required int requestLength, required int responseLength, required dynamic traceData, dynamic httpParams, String? responseBody}) Future<void>
Safely records HTTP transaction, catching any errors
safeStream<T>(Stream<T> streamGenerator()) Stream<T>
Safely executes an async generator with automatic error handling