storeServerpodCloudData static method

Future<void> storeServerpodCloudData({
  1. required ServerpodCloudData cloudData,
  2. required String localStoragePath,
})

Implementation

static Future<void> storeServerpodCloudData({
  required final ServerpodCloudData cloudData,
  required final String localStoragePath,
}) async {
  try {
    await LocalStorageManager.storeJsonFile(
      fileName: ResourceManagerConstants.serverpodCloudDataFilePath,
      json: cloudData.toJson(),
      localStoragePath: localStoragePath,
    );
  } on CreateException catch (e) {
    throw Exception(
      'Failed to store serverpod cloud data. error: ${e.error}',
    );
  } on SerializationException catch (e) {
    throw Exception(
      'Failed to store serverpod cloud data. error: ${e.error}',
    );
  } on WriteException catch (e) {
    throw Exception(
      'Failed to store serverpod cloud data. error: ${e.error}',
    );
  }
}