Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

Rename

Neeraj Gupta2e205d55d517
diff --git a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
index 3f4ceb875e..4e513845c2 100644
--- a/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
+++ b/mobile/apps/photos/plugins/ente_crypto/lib/src/crypto.dart
@@ -452,8 +452,8 @@ class CryptoUtil {
taskName: "decryptFile",
)
.catchError((e) {
- if (e.toString().contains(kLibSodiumErrorTag)) {
- throw CryptoErr("decryptFile", e);
+ if (e.toString().contains(kStreamPullError)) {
+ throw StreamPullErr("decryptFile", e);
} else {
throw e;
}
diff --git a/mobile/apps/photos/plugins/ente_crypto/lib/src/models/errors.dart b/mobile/apps/photos/plugins/ente_crypto/lib/src/models/errors.dart
index 9f02c4f47d..3fc1fa28c8 100644
--- a/mobile/apps/photos/plugins/ente_crypto/lib/src/models/errors.dart
+++ b/mobile/apps/photos/plugins/ente_crypto/lib/src/models/errors.dart
@@ -2,18 +2,18 @@ class KeyDerivationError extends Error {}
class LoginKeyDerivationError extends Error {}
-class CryptoErr implements Exception {
+class StreamPullErr implements Exception {
final String message;
final dynamic originalException;
- CryptoErr(this.message, [this.originalException]);
+ StreamPullErr(this.message, [this.originalException]);
@override
String toString() {
if (originalException != null) {
- return 'CryptoErr: $message\nCaused by: $originalException';
+ return 'StreamPullErr: $message\nCaused by: $originalException';
}
- return 'CryptoErr: $message';
+ return 'StreamPullErr: $message';
}
}
@@ -30,7 +30,7 @@ extension FutureErrorHandling<T> on Future<T> {
}
const kPartialReadErrorTag = 'PartialRead';
-const kLibSodiumErrorTag = 'crypto_secretstream_xchacha20poly1305_pull';
+const kStreamPullError = 'crypto_secretstream_xchacha20poly1305_pull';
// Exception counterpart for upstream handling via catchError chains
class PartialReadException implements Exception {