deleteAll method
Deletes multiple values associated with the given keys
.
Throws an ArgumentError if any key is empty. Throws a CacheException if there is an error deleting the data.
Implementation
Future<void> deleteAll(List<String> keys) async {
try {
if (keys.isEmpty) {
return;
}
// Check for empty keys
for (final key in keys) {
if (key.isEmpty) {
throw ArgumentError('Keys cannot be empty');
}
}
await _cacheAdapter.deleteAll(keys);
} on HiveError catch (e) {
_log.severe('Failed to delete data from cache (HiveError): $e');
throw CacheException('Failed to delete data from cache: ${e.message}');
} catch (e) {
_log.severe('Failed to delete data from cache (Unknown Error): $e');
throw CacheException('Failed to delete data from cache: $e');
}
}