Improve error reporting in storage service playground.

This commit is contained in:
Greyson Parrelli
2024-11-20 19:47:41 -05:00
parent 59fc650761
commit c5674a37b5
2 changed files with 9 additions and 1 deletions

View File

@@ -204,6 +204,9 @@ fun ViewScreen(
OneOffEvent.StorageRecordDecryptionError -> {
Toast.makeText(context, "Failed to decrypt storage records!", Toast.LENGTH_SHORT).show()
}
OneOffEvent.ManifestNotFoundError -> {
Toast.makeText(context, "Manifest not found!", Toast.LENGTH_SHORT).show()
}
}
}

View File

@@ -46,6 +46,11 @@ class InternalStorageServicePlaygroundViewModel : ViewModel() {
val manifest = when (val result = repository.getStorageManifest(storageKey)) {
is StorageServiceRepository.ManifestResult.Success -> result.manifest
is StorageServiceRepository.ManifestResult.NotFoundError -> {
Log.w(TAG, "Manifest not found!")
_oneOffEvents.value = OneOffEvent.ManifestNotFoundError
return@withContext
}
else -> {
Log.w(TAG, "Failed to fetch manifest!")
_oneOffEvents.value = OneOffEvent.ManifestDecryptionError
@@ -69,6 +74,6 @@ class InternalStorageServicePlaygroundViewModel : ViewModel() {
}
enum class OneOffEvent {
None, ManifestDecryptionError, StorageRecordDecryptionError
None, ManifestDecryptionError, StorageRecordDecryptionError, ManifestNotFoundError
}
}