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
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