-
-
Notifications
You must be signed in to change notification settings - Fork 281
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
We're getting 2 different status code for an exception hence causing conflict which one to use.
To Reproduce
- Upload an entity in Storage bucket
- Make in accessible, could be wrong path name or file name
- Make the download API call
Expected behavior
The status code should be 404 both in StorageException object and in nested message param.
Screenshots
Version (please complete the following information):
On Linux/macOS
Please run dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client" in your project directory and paste the output here.
hamza@M1-Max lensfolio_mobile_app % dart pub deps | grep -E "supabase|gotrue|postgrest|storage_client|realtime_client|functions_client"
├── supabase_flutter 2.12.0
│ ├── supabase 2.10.2
│ │ ├── functions_client 2.5.0
│ │ ├── gotrue 2.18.0
│ │ ├── postgrest 2.6.0
│ │ ├── realtime_client 2.7.0
│ │ ├── storage_client 2.4.1
Additional context
The object for me does exists on storage, the policy for storage is to read by any authenticated user yet i'm facing this issue.
- Bucket name: 'resumes'
- File path: 'resumes/uuid.png'
Code snippet:
static Future<File> downloadResume(String filePath) async {
try {
final file = await AppSupabase.supabase.storage
.from(SupaBuckets.resumes)
.download(filePath);
return File.fromRawPath(file);
} catch (e, st) {
if (e is StorageException) {
throw SupaStorageFault.fromStorageException(e, st);
}
throw UnknownFault('Something went wrong!', st);
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working