statusDescription property

String statusDescription

Implementation

String get statusDescription {
  if (isUnsupportedScheme) return 'scheme unsupported';
  if (isInvalid) return 'invalid URL';
  if (didNotConnect) return 'connection failed';
  if (wasDeniedByRobotsTxt) return 'denied by robots.txt';
  if (hasNoMimeType) return 'server reported no mime type';
  if (!wasTried) return "wasn't tried";
  if (statusCode == 200) return 'HTTP 200';
  if (isRedirected) {
    final path =
        redirects.map((redirect) => redirect.statusCode).join(' -> ');
    return 'HTTP $path => $statusCode';
  }
  return 'HTTP $statusCode';
}