diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 3284a60172f0a4d63d72206154934dfbe6df53b2..dc8d1738b054bde6e241968e069dea52e437b7fc 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -253,7 +253,7 @@ class Storage extends DAV implements ISharedStorage {
 			// throw this to be on the safe side: the share will still be visible
 			// in the UI in case the failure is intermittent, and the user will
 			// be able to decide whether to remove it if it's really gone
-			throw new NotFoundException();
+			throw new StorageNotAvailableException();
 		}
 
 		return json_decode($response->getBody(), true);