Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Commit a972b99

Browse files
aarichsoedirgo
authored andcommitted
fix(types): update throwOnError return type to this
1 parent 70ed485 commit a972b99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/lib/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export abstract class PostgrestBuilder<T> implements PromiseLike<PostgrestRespon
8080
*
8181
* {@link https://github.com/supabase/supabase-js/issues/92}
8282
*/
83-
throwOnError(throwOnError?: boolean): PostgrestBuilder<T> {
83+
throwOnError(throwOnError?: boolean): this {
8484
if (throwOnError === null || throwOnError === undefined) {
8585
throwOnError = true
8686
}

test/basic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ test('throwOnError throws errors instead of returning them', async () => {
133133
let isErrorCaught = false
134134

135135
try {
136-
await postgrest.from('missing_table').select().throwOnError()
136+
await postgrest.from('missing_table').throwOnError().select()
137137
} catch (error) {
138138
expect(error).toMatchSnapshot()
139139
isErrorCaught = true

0 commit comments

Comments
 (0)