tryFetchServerpodCloudData static method
Future<ServerpodCloudData?>
tryFetchServerpodCloudData({
- required String localStoragePath,
- required CommandLogger logger,
Implementation
static Future<ServerpodCloudData?> tryFetchServerpodCloudData({
required final String localStoragePath,
required final CommandLogger logger,
}) async {
try {
return await LocalStorageManager.tryFetchAndDeserializeJsonFile(
fileName: ResourceManagerConstants.serverpodCloudDataFilePath,
localStoragePath: localStoragePath,
fromJson: ServerpodCloudData.fromJson,
);
} on ReadException catch (_) {
logger.error(
'Could not read file at location ${ResourceManagerConstants.serverpodCloudDataFilePath}.',
hint:
'Please check that the Serverpod Cloud CLI has the correct permissions to '
'read the file. If the problem persists, try deleting the file.');
return null;
} on DeserializationException catch (_) {
return null;
}
}