Replaces panic() calls with proper error propagation in the template loader when dialers are missing or wait group creation fails. Fixes #6674.
pkg/catalog/loader/loader.goLoadTemplatesWithTags signature to return ([]*templates.Template, error) instead of []*templates.TemplateLoadTemplates signature to return ([]*templates.Template, error) to matchpanic("dialers with executionId ... not found") with return nil, fmt.Errorf(...)panic("could not create wait group") with return nil, fmt.Errorf(...)dialers variable assignment (inlined the nil check)Load() to handle the error from LoadTemplates by logging itinternal/runner/lazy.goGetLazyAuthFetchCallback to handle the new error return from LoadTemplatespkg/protocols/common/automaticscan/util.goLoadTemplatesWithTags caller to handle the new error returnpkg/catalog/loader/loader_bench_test.go_, _ = for the two-value returnWhen dialers were missing or wait group creation failed, the application would panic(), causing an unrecoverable crash with no meaningful error message to the user.
Errors are properly propagated up the call chain. Callers can handle the error gracefully (log it, return it, etc.) instead of crashing.
LoadTemplatesWithTagsLoadTemplatesgo build ./...)/claim #6674
Bug Fixes
Refactor
Tests
a638011
@a638011
ProjectDiscovery
@projectdiscovery
Madhavan Deepak
@Madhavan-Deepak