mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 13:08:46 +00:00
Improve error reporting in storage service playground.
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user