ApiErrorMonitor class

Main class for monitoring and reporting API errors

Constructors

ApiErrorMonitor({required String appName, String? discordWebhookUrl, bool enableInDebugMode = false, bool enableLocalLogging = true, String? customLogDirectory, int maxRetries = 3, Duration retryDelay = const Duration(seconds: 5), bool enabled = true})
ApiErrorMonitor.fromConfig(ApiErrorMonitorConfig config)
Create from config

Properties

hashCode → int
The hash code for this object.
no setterinherited
isEnabled → bool
Check if reporting is enabled
no setter
queueSize → int
Get queue size
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

capture(dynamic error, {StackTrace? stackTrace, required String endpoint, Map<String, dynamic>? requestData, dynamic responseData, String? key, String? expectedType, String? receivedType}) → Future<void>
Capture and report an API error Focuses on type mismatch and parsing errors, ignores network errors
clearLocalReports() → Future<bool>
Clear all local error reports
clearQueue() → void
Clear queue
getLocalLogDirectoryPath() → String?
Get local log directory path
getLocalReports() → Future<List<ApiErrorReport>>
Get all local error reports
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
processQueue() → Future<void>
Process queued reports (call this when network is available)
toString() → String
A string representation of this object.
inherited

Operators

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