BadResponseException.fromString constructor

BadResponseException.fromString(
  1. String message
)

Implementation

BadResponseException.fromString (this.message) : statusCode = -1 {
  final regExp =  RegExp(r'\d+',
                            caseSensitive: false,
                            multiLine: false);

  final match = regExp.stringMatch(message);
  if (match != null)
  {
    statusCode = int.parse(match);
  }
}