Replace panic with proper error return in template loader when dialers are missing, allowing callers to handle the situation gracefully.
pkg/catalog/loader/loader.goLoadTemplatesWithTags signature: []*templates.Template → ([]*templates.Template, error)LoadTemplates signature: []*templates.Template → ([]*templates.Template, error)Load signature: void → errorpanic("dialers with executionId...") with fmt.Errorf("dialers with executionId %s not found", ...)panic("could not create wait group") with fmt.Errorf("could not create wait group: %w", errWg)internal/runner/lazy.go - Handle error from LoadTemplatesinternal/runner/runner.go - Handle error from Loadinternal/server/nuclei_sdk.go - Handle error from Loadlib/multi.go - Handle error from Loadlib/sdk.go - Handle error from Loadcmd/integration-test/library.go - Handle error from Loadpkg/protocols/common/automaticscan/util.go - Handle error from LoadTemplatesWithTagspkg/catalog/loader/loader_bench_test.go - Update to handle two return valuesBefore (panic):
panic: dialers with executionId abc123 not found
After (graceful error):
templates, err := store.LoadTemplates(templatesList)
if err != nil {
// Error: "dialers with executionId abc123 not found"
// Caller can handle gracefully
return err
}
go build ./... passesgo vet ./... passesgo test ./pkg/catalog/loader/... passesFixes #6674
/claim #6674
Bug Fixes
Tests
Style
Gregorius Bima Kharisma Wicaksana
@bimakw
ProjectDiscovery
@projectdiscovery
Madhavan Deepak
@Madhavan-Deepak