/claim #6674
Fixes #6674
Changes
Replaced panic calls with proper error returns when network dialers are missing, preventing unexpected crashes.
Latest update (addressing CodeRabbit feedback):
- Fixed template/workflow loading error handling to properly propagate failures
- Changed
Load() to return error instead of silently swallowing failures
- Updated
LoadTemplates() and LoadWorkflows() to return errors
- Updated all callers to check and handle errors properly (lib/sdk.go, lib/multi.go, internal/runner/runner.go, internal/server/nuclei_sdk.go, cmd/integration-test/library.go, internal/runner/lazy.go)
Files Changed
pkg/catalog/loader/loader.go
pkg/fuzz/execute.go
pkg/protocols/common/automaticscan/util.go
pkg/templates/compile.go
lib/sdk.go, lib/multi.go
internal/runner/runner.go, internal/runner/lazy.go
internal/server/nuclei_sdk.go
cmd/integration-test/library.go
pkg/catalog/loader/loader_bench_test.go
Testing
- ✅ Builds cleanly (
go build ./...)
- ✅ All compilation errors from CodeRabbit review addressed
- ✅ Branch is rebased on latest
dev
- ✅ No new panics possible in the affected code paths
- ✅ Error propagation tested across all callers
Summary by CodeRabbit
-
Bug Fixes
- Template/workflow loading now surfaces and returns errors instead of failing silently; operations that depend on templates will stop and report failures when loading fails.
-
Refactor
- Loading flow rewritten to aggregate and propagate parsing/loading errors, avoid partial initialization, and provide clearer diagnostics for failures.