Skip to content

feat(storage): add new storage exception and expose code parameter - #1376

Open
jan-tennert wants to merge 3 commits into
masterfrom
storage-exception
Open

feat(storage): add new storage exception and expose code parameter#1376
jan-tennert wants to merge 3 commits into
masterfrom
storage-exception

Conversation

@jan-tennert

Copy link
Copy Markdown
Collaborator

What kind of change does this PR introduce?

Feature (closes #1372)

This pull request refactors error handling in the Storage module to provide more detailed and structured exceptions for storage API errors. Instead of using generic or HTTP-based exceptions, a new StorageRestException is introduced, which includes a service-specific error code for improved error handling and debugging. Imports are cleaned up, and the error response data class is updated to include the new code field.

Error handling improvements:

  • Replaced previous exception handling logic in StorageImpl to always throw a new StorageRestException, which provides a more detailed and consistent error structure, including the storage-specific error code.
  • Added new StorageRestException class to encapsulate storage-specific error details, including the API error code, message, and HTTP status code.
  • Updated StorageErrorResponse data class to include a code field for the service-specific error code from the Storage API.

Codebase cleanup:

  • Removed unused exception and HTTP imports from Storage.kt to simplify dependencies.
  • Made the statusCode property in RestException open, allowing subclasses like StorageRestException to override it.

@jan-tennert
jan-tennert marked this pull request as ready for review August 14, 2026 10:31
@github-actions github-actions Bot added the tests label Aug 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

parity(storage): expose service error code on storage error type [from supabase-js]

1 participant