fromMap static method

DataStoreException fromMap(
  1. Map<String, String> serializedException
)
override

Instantiates and return a new DataStoreException from the serialized exception data

Implementation

static DataStoreException fromMap(Map<String, String> serializedException) {
  if (serializedException['message'] == null) {
    throw const FormatException(
      'Cannot create AmplifyException from map.  Message field is missing',
    );
  }

  return DataStoreException(
    serializedException['message']!,
    recoverySuggestion: serializedException['recoverySuggestion'],
    underlyingException: serializedException['underlyingException'],
  );
}