err handling + fixing scope issue

This commit is contained in:
ParthSareen
2025-02-11 19:29:48 -08:00
parent aa6d5151df
commit ffd6428758
2 changed files with 29 additions and 20 deletions

View File

@@ -17,9 +17,13 @@ type JSONSampler struct {
}
func NewJSONSampler(proc model.TextProcessor, schema *Schema) (*JSONSampler, error) {
if proc == nil {
return nil, fmt.Errorf("TextProcessor cannot be nil")
}
pdaSampler, err := NewPushdownSampler(proc)
if err != nil {
return nil, err
return nil, fmt.Errorf("failed to create PushdownSampler: %w", err)
}
if schema == nil {