This repository was archived by the owner on Oct 9, 2025. It is now read-only.
  
  
  - 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 52
 
StorageError shape doesn't match returned errors from APIΒ #165
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Bug report
- I confirm this is a bug with Supabase, not with my own application.
 - I confirm I have searched the Docs, GitHub Discussions, and Discord.
 
Describe the bug
The StorageApiError class defined in storage-js has a status field.
The StorageError defined in storage-api has a statusCode field.
This mismatch make it difficult to correctly handle errors on the frontend.
I'd like to use the isStorageError function defined in storage-js, but it does not recognize errors thrown from the API
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Upload a file
 - Upload the same file without allowing upserts
 - Throw the returned error
 
  const { error } = await supabase.storage
    .from('bucket')
    .upload(filename, buffer, {
      upsert: false,
    });
  console.log(isStorageError(error)) -- this is false, but should be trueExpected behavior
isStorageError correctly identifies when the storage API has thrown an error.
StorageApiError has the correct fields that correspond to the returned error.
System information
- Version of supabase-js: 2.2.0 (though this mismatch persists in the main branch)
 
bombillazo and dogukanakkaya
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working