outerbase / sdk

Typescript ORM and automated model generation direct from your database schema. Supports Outerbase features for saved queries & AI.
https://outerbase.com
MIT License
12 stars 5 forks source link

Connections `OuterbaseConnection` and `CloudflareD1Connection` do not throw Errors #33

Open Brayden opened 5 months ago

Brayden commented 5 months ago

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 commented 4 months ago

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