Description

Replaced panic() calls in LoadTemplatesWithTags with proper error returns, allowing callers to handle failures gracefully instead of crashing.

/claim #6674

Changes

pkg/catalog/loader/loader.go

  • Changed LoadTemplates() signature to return ([]*templates.Template, error)
  • Changed LoadTemplatesWithTags() signature to return ([]*templates.Template, error)
  • Replaced panic("could not create wait group") with return nil, fmt.Errorf(...)
  • Replaced panic("dialers with executionId ... not found") with return nil, fmt.Errorf(...)
  • Updated Load() to handle error from LoadTemplates()

internal/runner/lazy.go

  • Updated GetLazyAuthFetchCallback to handle error from LoadTemplates()

pkg/protocols/common/automaticscan/util.go

  • Updated LoadTemplatesWithTags wrapper to propagate error from store method

Testing

  • All changes follow the existing codebase pattern of returning fmt.Errorf for error conditions
  • No behavioral change for success paths; only error paths are improved
  • Callers that previously would crash now receive descriptive errors

Checklist

  • PR created against the dev branch
  • Descriptive commit message with issue reference
  • Changes are minimal and focused on the issue

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved error handling for template loading operations to prevent silent failures and ensure proper error reporting when templates cannot be loaded successfully.

Claim

Total prize pool $200
Total paid $0
Status Pending
Submitted February 15, 2026
Last updated February 15, 2026

Contributors

FA

fayanwubian-hue

@fayanwubian-hue

100%

Sponsors

PR

ProjectDiscovery

@projectdiscovery

$100
MA

Madhavan Deepak

@Madhavan-Deepak

$100