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

Commit ac7e005

Browse files
committed
Returning error instead of panic
1 parent 4973f5e commit ac7e005

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

platform/backend_connectors/hydrolix_backend_connector.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func (p *HydrolixBackendConnector) makeRequest(ctx context.Context, method strin
8383
// Build the request
8484
req, err := http.NewRequestWithContext(ctx, method, url, bytes.NewBuffer(body))
8585
if err != nil {
86-
panic(err)
86+
return nil, err
8787
}
8888

8989
// Set headers
@@ -206,7 +206,7 @@ func (p *HydrolixBackendConnector) Exec(_ context.Context, query string, args ..
206206
// Top-level object
207207
var root map[string]json.RawMessage
208208
if err := json.Unmarshal([]byte(query), &root); err != nil {
209-
panic(err)
209+
return err
210210
}
211211

212212
// Extract each section into its own map (or struct, if needed)
@@ -215,13 +215,13 @@ func (p *HydrolixBackendConnector) Exec(_ context.Context, query string, args ..
215215
var ingestSlice []map[string]interface{}
216216

217217
if err := json.Unmarshal(root["create_table"], &createTable); err != nil {
218-
panic(err)
218+
return err
219219
}
220220
if err := json.Unmarshal(root["transform"], &transform); err != nil {
221-
panic(err)
221+
return err
222222
}
223223
if err := json.Unmarshal(root["ingest"], &ingestSlice); err != nil {
224-
panic(err)
224+
return err
225225
}
226226
tableName := createTable["name"].(string)
227227

0 commit comments

Comments
 (0)