Skip to content

Commit 0726579

Browse files
authored
pass error response structure by reference in Client.sendRequest (nedpals#11)
Co-authored-by: Richard Scorer <[email protected]>
1 parent 3384faa commit 0726579

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode
1+
.vscode
2+
.idea

supabase.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ import (
1111
)
1212

1313
const (
14-
AuthEndpoint = "auth/v1"
15-
RestEndpoint = "rest/v1"
14+
AuthEndpoint = "auth/v1"
15+
RestEndpoint = "rest/v1"
1616
StorageEndpoint = "storage/v1"
1717
)
1818

@@ -22,7 +22,7 @@ type Client struct {
2222
apiKey string
2323
HTTPClient *http.Client
2424
Auth *Auth
25-
Storage *Storage
25+
Storage *Storage
2626
DB *postgrest.Client
2727
}
2828

@@ -72,7 +72,7 @@ func injectAuthorizationHeader(req *http.Request, value string) {
7272

7373
func (c *Client) sendRequest(req *http.Request, v interface{}) error {
7474
var errRes ErrorResponse
75-
hasCustomError, err := c.sendCustomRequest(req, v, errRes)
75+
hasCustomError, err := c.sendCustomRequest(req, v, &errRes)
7676

7777
if err != nil {
7878
return err

0 commit comments

Comments
 (0)