mirror of
https://github.com/projectdiscovery/nuclei.git
synced 2025-12-17 20:15:27 +00:00
* fix: remove undefined errorutil.ShowStackTrace * feat: add make lint support and integrate with test * refactor: migrate errorutil to errkit across codebase - Replace deprecated errorutil with modern errkit - Convert error declarations from var to func for better compatibility - Fix all SA1019 deprecation warnings - Maintain error chain support and stack traces * fix: improve DNS test reliability using Google DNS - Configure test to use Google DNS (8.8.8.8) for stability - Fix nil pointer issue in DNS client initialization - Keep production defaults unchanged * fixing logic * removing unwanted branches in makefile --------- Co-authored-by: Mzack9999 <mzack9999@protonmail.com>
29 lines
880 B
Go
29 lines
880 B
Go
package templates
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/projectdiscovery/utils/errkit"
|
|
)
|
|
|
|
// Helper functions for template errors with formatting
|
|
func ErrMandatoryFieldMissingFmt(field string) error {
|
|
return errkit.New(fmt.Sprintf("mandatory '%s' field is missing", field)).Build()
|
|
}
|
|
|
|
func ErrInvalidField(field, format string) error {
|
|
return errkit.New(fmt.Sprintf("invalid field format for '%s' (allowed format is %s)", field, format)).Build()
|
|
}
|
|
|
|
func ErrWarningFieldMissing(field string) error {
|
|
return errkit.New(fmt.Sprintf("field '%s' is missing", field)).Build()
|
|
}
|
|
|
|
func ErrCouldNotLoadTemplate(path, reason string) error {
|
|
return errkit.New(fmt.Sprintf("Could not load template %s: %s", path, reason)).Build()
|
|
}
|
|
|
|
func ErrLoadedWithWarnings(path, warning string) error {
|
|
return errkit.New(fmt.Sprintf("Loaded template %s: with syntax warning : %s", path, warning)).Build()
|
|
}
|