Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][common] Handle url update err

Neeraj Gupta7923d695506e
diff --git a/mobile/packages/sharing/lib/collection_sharing_service.dart b/mobile/packages/sharing/lib/collection_sharing_service.dart
index d6e4467dd5..35213884da 100644
--- a/mobile/packages/sharing/lib/collection_sharing_service.dart
+++ b/mobile/packages/sharing/lib/collection_sharing_service.dart
@@ -122,6 +122,10 @@ class CollectionSharingService {
if (e.response?.statusCode == 402) {
throw SharingNotPermittedForFreeAccountsError();
}
+ if (e.response?.statusCode == 403 &&
+ e.response?.data?['code'] == 'LINK_EDIT_NOT_ALLOWED') {
+ throw LinkEditNotAllowedError();
+ }
rethrow;
} catch (e, s) {
_logger.severe("failed to update ShareUrl", e, s);
diff --git a/mobile/packages/sharing/lib/errors.dart b/mobile/packages/sharing/lib/errors.dart
index 371af78fc2..619b96b406 100644
--- a/mobile/packages/sharing/lib/errors.dart
+++ b/mobile/packages/sharing/lib/errors.dart
@@ -1 +1,3 @@
class SharingNotPermittedForFreeAccountsError extends Error {}
+
+class LinkEditNotAllowedError extends Error {}