Skip to content

Commit

Permalink
Merge pull request #637 from meshery/leecalcote/chore/generate-error-…
Browse files Browse the repository at this point in the history
…codes

Leecalcote/chore/generate-error-codes
  • Loading branch information
leecalcote authored Jan 12, 2025
2 parents bcd0eb0 + 617c8c7 commit 8bea168
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 38 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/error-codes-updater.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:

- name: Run utility
run: |
go run github.com/meshery/meshkit/cmd/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers
go run github.com/layer5io/meshkit/cmd/errorutil -d . update --skip-dirs meshery -i ./helpers -o ./helpers
- name: Pull changes from remote
run: git pull origin master
Expand Down
14 changes: 7 additions & 7 deletions encoding/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import (
)

const (
ErrDecodeYamlCode = ""
ErrUnmarshalCode = ""
ErrUnmarshalInvalidCode = ""
ErrUnmarshalSyntaxCode = ""
ErrUnmarshalTypeCode = ""
ErrUnmarshalUnsupportedTypeCode = ""
ErrUnmarshalUnsupportedValueCode = ""
ErrDecodeYamlCode = "meshkit-11245"
ErrUnmarshalCode = "meshkit-11246"
ErrUnmarshalInvalidCode = "meshkit-11247"
ErrUnmarshalSyntaxCode = "meshkit-11248"
ErrUnmarshalTypeCode = "meshkit-11249"
ErrUnmarshalUnsupportedTypeCode = "meshkit-11250"
ErrUnmarshalUnsupportedValueCode = "meshkit-11251"
)

// ErrDecodeYaml is the error when the yaml unmarshal fails
Expand Down
4 changes: 2 additions & 2 deletions generators/artifacthub/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ var (
ErrGetAhPackageCode = "meshkit-11135"
ErrComponentGenerateCode = "meshkit-11136"
ErrGetAllHelmPackagesCode = "meshkit-11137"
ErrChartUrlEmptyCode = "replace_me"
ErrNoPackageFoundCode = "replace_me"
ErrChartUrlEmptyCode = "meshkit-11252"
ErrNoPackageFoundCode = "meshkit-11253"
)

func ErrGetAllHelmPackages(err error) error {
Expand Down
2 changes: 1 addition & 1 deletion helpers/component_info.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "meshkit",
"type": "library",
"next_error_code": 11245
"next_error_code": 11279
}
2 changes: 1 addition & 1 deletion models/meshmodel/core/v1beta1/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package v1beta1
import "github.com/layer5io/meshkit/errors"

const (
ErrUnknownKindCode = ""
ErrUnknownKindCode = "meshkit-11254"
)

func ErrUnknownKind(err error) error {
Expand Down
16 changes: 8 additions & 8 deletions models/meshmodel/registry/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import (
)

var (
ErrUnknownHostCode = "replace_me"
ErrEmptySchemaCode = "replace_me"
ErrMarshalingRegisteryAttemptsCode = "replace_me"
ErrWritingRegisteryAttemptsCode = "replace_me"
ErrRegisteringEntityCode = "replace_me"
ErrUnknownHostInMapCode = "replace_me"
ErrCreatingUserDataDirectoryCode = "replace_me"
ErrGetByIdCode = "replace_me"
ErrUnknownHostCode = "meshkit-11255"
ErrEmptySchemaCode = "meshkit-11256"
ErrMarshalingRegisteryAttemptsCode = "meshkit-11257"
ErrWritingRegisteryAttemptsCode = "meshkit-11258"
ErrRegisteringEntityCode = "meshkit-11259"
ErrUnknownHostInMapCode = "meshkit-11260"
ErrCreatingUserDataDirectoryCode = "meshkit-11261"
ErrGetByIdCode = "meshkit-11262"
)

func ErrGetById(err error, id string) error {
Expand Down
6 changes: 3 additions & 3 deletions models/oci/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ var (
ErrAddLayerCode = "meshkit-11247"
ErrTaggingPackageCode = "meshkit-11248"
ErrPushingPackageCode = "meshkit-11249"
ErrSeekFailedCode = "replace_me"
ErrCreateLayerCode = "replace_me"
ErrSavingImageCode = "replace_me"
ErrSeekFailedCode = "meshkit-11263"
ErrCreateLayerCode = "meshkit-11264"
ErrSavingImageCode = "meshkit-11265"
)

func ErrAppendingLayer(err error) error {
Expand Down
2 changes: 1 addition & 1 deletion models/patterns/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package patterns
import "github.com/layer5io/meshkit/errors"

const (
ErrInvalidVersionCode = ""
ErrInvalidVersionCode = "meshkit-11266"
)

func ErrInvalidVersion(err error) error {
Expand Down
12 changes: 6 additions & 6 deletions models/registration/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ import (
)

const (
ErrDirPkgUnitParseFailCode = "replace_me"
ErrGetEntityCode = "replace_me"
ErrRegisterEntityCode = "replace_me"
ErrImportFailureCode = "replace_me"
ErrMissingRegistrantCode = "replace_me"
ErrSeedingComponentsCode = "replace-me"
ErrDirPkgUnitParseFailCode = "meshkit-11267"
ErrGetEntityCode = "meshkit-11268"
ErrRegisterEntityCode = "meshkit-11269"
ErrImportFailureCode = "meshkit-11270"
ErrMissingRegistrantCode = "meshkit-11271"
ErrSeedingComponentsCode = "meshkit-11272"
)

func ErrSeedingComponents(err error) error {
Expand Down
15 changes: 7 additions & 8 deletions utils/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,16 @@ var (
ErrExtractTarXZCode = "meshkit-11184"
ErrExtractZipCode = "meshkit-11185"
ErrReadDirCode = "meshkit-11186"
ErrInvalidSchemaVersionCode = "replace_me"
ErrFileWalkDirCode = "replace_me"
ErrRelPathCode = "replace_me"
ErrCopyFileCode = "replace_me"
ErrCloseFileCode = "replace_me"
ErrInvalidSchemaVersionCode = "meshkit-11273"
ErrFileWalkDirCode = "meshkit-11274"
ErrRelPathCode = "meshkit-11275"
ErrCopyFileCode = "meshkit-11276"
ErrCloseFileCode = "meshkit-11277"
ErrCompressToTarGZCode = "meshkit-11248"

ErrConvertToByteCode = "meshkit-11187"

ErrOpenFileCode = "replace_me"
ErrConvertToByteCode = "meshkit-11187"

ErrOpenFileCode = "meshkit-11278"
)
var (
ErrExtractType = errors.New(
Expand Down

0 comments on commit 8bea168

Please sign in to comment.