Skip to content

Commit

Permalink
Merge pull request #683 from souvikinator/souvik/fix/error-util
Browse files Browse the repository at this point in the history
Revert check for errors.go in errorutils
  • Loading branch information
souvikinator authored Feb 14, 2025
2 parents 73559a2 + 606eaf1 commit a6241b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion cmd/errorutil/internal/coder/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func walk(globalFlags globalFlags, update bool, updateAll bool, errorsInfo *mesh

func isErrorGoFile(path string) bool {
_, file := filepath.Split(path)
return file == "error.go" || file == "errors.go"
return file == "error.go"
}

func includeFile(path string) bool {
Expand Down
30 changes: 15 additions & 15 deletions files/errors.go → files/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ import (

var (
// Error code
ErrUnsupportedExtensionCode = "meshkit-11282"
ErrUnsupportedExtensionForOperationCode = "meshkit-11283"
ErrFailedToIdentifyFileCode = "meshkit-11284"
ErrSanitizingFileCode = "meshkit-11285"
ErrInvalidYamlCode = "meshkit-11286"
ErrInvalidJsonCode = "meshkit-11287"
ErrFailedToExtractTarCode = "meshkit-11288"
ErrUnsupportedFileTypeCode = "meshkit-11289"
ErrInvalidKubernetesManifestCode = "meshkit-11290"
ErrInvalidMesheryDesignCode = "meshkit-11291"
ErrInvalidHelmChartCode = "meshkit-11292"
ErrInvalidDockerComposeCode = "meshkit-11293"
ErrInvalidKustomizationCode = "meshkit-11294"
ErrFileTypeNotSupportedForDesignConversion = "replace_me"
ErrUnsupportedExtensionCode = "meshkit-11282"
ErrUnsupportedExtensionForOperationCode = "meshkit-11283"
ErrFailedToIdentifyFileCode = "meshkit-11284"
ErrSanitizingFileCode = "meshkit-11285"
ErrInvalidYamlCode = "meshkit-11286"
ErrInvalidJsonCode = "meshkit-11287"
ErrFailedToExtractTarCode = "meshkit-11288"
ErrUnsupportedFileTypeCode = "meshkit-11289"
ErrInvalidKubernetesManifestCode = "meshkit-11290"
ErrInvalidMesheryDesignCode = "meshkit-11291"
ErrInvalidHelmChartCode = "meshkit-11292"
ErrInvalidDockerComposeCode = "meshkit-11293"
ErrInvalidKustomizationCode = "meshkit-11294"
ErrFileTypeNotSupportedForDesignConversionCode = "replace_me"
)

func ErrUnsupportedExtensionForOperation(operation string, fileName string, fileExt string, supportedExtensions []string) error {
Expand Down Expand Up @@ -311,7 +311,7 @@ func ErrUnsupportedFileTypeForConversionToDesign(fileName string, fileType strin
"Convert the file to a supported format before processing",
}

return errors.New(ErrFileTypeNotSupportedForDesignConversion, errors.Critical, sdescription, ldescription, probableCause, remedy)
return errors.New(ErrFileTypeNotSupportedForDesignConversionCode, errors.Critical, sdescription, ldescription, probableCause, remedy)
}

var (
Expand Down

0 comments on commit a6241b2

Please sign in to comment.