Improve error handling across the board

This commit is contained in:
2025-03-25 17:23:50 +01:00
parent 20bab894e3
commit 1bcc6735ab
5 changed files with 207 additions and 123 deletions

View File

@@ -57,9 +57,9 @@ func (p *JSONProcessor) ProcessContent(content string, pattern string, luaExpr s
}
// Find nodes matching the JSONPath pattern
nodes := jsonpath.Get(jsonData, pattern)
nodes, err := jsonpath.Get(jsonData, pattern)
if err != nil {
return content, 0, 0, fmt.Errorf("error executing JSONPath: %v", err)
return content, 0, 0, fmt.Errorf("error getting nodes: %v", err)
}
matchCount := len(nodes)