onError method

  1. @override
void onError(
  1. String method,
  2. String url,
  3. dynamic error
)
override

Called when an error occurs

Implementation

@override
void onError(String method, String url, dynamic error) {
  if (!enabled || !this.error) return;

  // Clean up timestamp
  _requestTimestamps.remove(url);

  final errorBlock = StringBuffer();
  errorBlock.writeln('╔╣ Error ║ $method');
  errorBlock.writeln('║  $url');
  errorBlock.writeln('║  $error');
  errorBlock.write('╚ ${_repeatChar('═', maxWidth)}');
  logPrint(errorBlock.toString());
}