Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connections OuterbaseConnection and CloudflareD1Connection do not throw Errors #33

Open
Brayden opened this issue May 29, 2024 · 1 comment
Labels
blocked When an issue is blocked by another issue bug Something isn't working good first issue Good for newcomers

Comments

@Brayden
Copy link
Member

Brayden commented May 29, 2024

Describe the bug
When making requests to the database via the OuterbaseConnection or the CloudflareD1Connection and an error is returned from either of those connections, the error never propagates back to the caller. If you look at the code null is actually hard coded as the return value there.

To Reproduce

  1. Fire a query that is doomed to fail
  2. Log out the error from const { data, error } = db....
  3. Always see null for error

Expected Result is to see an error object.

Expected behavior
Return an error in a standardized ConnectionError object similar to the type below:

export interface ConnectionError {
    code: string
    status: number
    title: string
    message: string
}

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
N/A

@erikkristoferanderson
Copy link

Thanks @caleb-mabry for looking through this one with me.

@caleb-mabry caleb-mabry added the blocked When an issue is blocked by another issue label Jul 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked When an issue is blocked by another issue bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants