fromMap static method

ApiException fromMap(
  1. Map<String, String> serializedException
)

Instantiates and return a new ApiException from the serialized exception data

Implementation

static ApiException fromMap(Map<String, String> serializedException) {
  var statusCode = int.tryParse(serializedException['httpStatusCode'] ?? '');
  // Ensure a valid HTTP status code for an error.
  if (statusCode != null && (statusCode < 300 || statusCode > 511)) {
    statusCode = null;
  }
  return ApiException._private(
    AmplifyException.fromMap(serializedException),
    statusCode,
  );
}