Comments (7)
It means the error code, eg 11001, or a placeholder (where it makes sense until the placeholder is replaced) is assigned to several error code variables, i. e. variables that follow the naming convention Err[A-Z]*.
from meshkit.
This is exciting! // @alonsolopezr
from meshkit.
The first draft version of the tool finds all variables starting with "Err[A-Z]" and groups them.
It also catches and groups variables that are not string literals but string literals resulting from call expressions.
Different presentation of this list and min/max codes, duplicates, and more will follow.
Update of the actual source code will also follow... later - a couple of design issues are not finalized yet.
{
"LiteralCodes": {
"1000": [
{
"name": "ErrGetName",
"code": "1000",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1001": [
{
"name": "ErrInstallMesh",
"code": "1001",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1002": [
{
"name": "ErrMeshConfig",
"code": "1002",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1003": [
{
"name": "ErrPortForward",
"code": "1003",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1004": [
{
"name": "ErrClientConfig",
"code": "1004",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1005": [
{
"name": "ErrClientSet",
"code": "1005",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1006": [
{
"name": "ErrStreamEvent",
"code": "1006",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1007": [
{
"name": "ErrOpInvalid",
"code": "1007",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1008": [
{
"name": "ErrApplyOperation",
"code": "1008",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"1009": [
{
"name": "ErrListOperations",
"code": "1009",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"11000": [
{
"name": "ErrConnectCode",
"code": "11000",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "broker/nats/error.go"
},
{
"name": "ErrEncodedConnCode",
"code": "11000",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "broker/nats/error.go"
}
],
"11001": [
{
"name": "ErrPublishCode",
"code": "11001",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "broker/nats/error.go"
},
{
"name": "ErrPublishRequestCode",
"code": "11001",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "broker/nats/error.go"
},
{
"name": "ErrQueueSubscribeCode",
"code": "11001",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "broker/nats/error.go"
}
],
"600": [
{
"name": "ErrPanic",
"code": "600",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"601": [
{
"name": "ErrGrpcListener",
"code": "601",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"602": [
{
"name": "ErrGrpcServer",
"code": "602",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"700": [
{
"name": "ErrEmptyConfig",
"code": "700",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"701": [
{
"name": "ErrInMem",
"code": "701",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"702": [
{
"name": "ErrViper",
"code": "702",
"codeIsLiteral": true,
"codeIsInt": true,
"path": "errors/codes.go"
}
],
"kit_10200": [
{
"name": "ErrSmiInit",
"code": "kit_10200",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10201": [
{
"name": "ErrInstallSmi",
"code": "kit_10201",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10202": [
{
"name": "ErrConnectSmi",
"code": "kit_10202",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10203": [
{
"name": "ErrRunSmi",
"code": "kit_10203",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10204": [
{
"name": "ErrDeleteSmi",
"code": "kit_10204",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10205": [
{
"name": "ErrUnmarshal",
"code": "kit_10205",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
},
{
"name": "ErrMarshal",
"code": "kit_10205",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
},
{
"name": "ErrGetBool",
"code": "kit_10205",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10206": [
{
"name": "ErrApplyManifest",
"code": "kit_10206",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10207": [
{
"name": "ErrServiceDiscovery",
"code": "kit_10207",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10208": [
{
"name": "ErrLoadFile",
"code": "kit_10208",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"kit_10209": [
{
"name": "ErrApplyHelmChart",
"code": "kit_10209",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "errors/codes.go"
}
],
"meshkit_test_code": [
{
"name": "ErrExposeResourceCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrGettingResourceCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrTraverserCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrResourceCannotBeExposedCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrSelectorBasedMapCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrProtocolBasedMapCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrLableBasedMapCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrPortParsingCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrGenerateServiceCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrConstructingRestHelperCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrCreatingServiceCode",
"code": "meshkit_test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
}
],
"test": [
{
"name": "ErrNoneDatabaseCode",
"code": "test",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "database/error.go"
},
{
"name": "ErrDatabaseOpenCode",
"code": "test",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "database/error.go"
}
],
"test_code": [
{
"name": "ErrApplyManifestCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrServiceDiscoveryCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrApplyHelmChartCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrNewKubeClientCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrNewDynClientCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrNewDiscoveryCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrNewInformerCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrEndpointNotFoundCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrInvalidAPIServerCode",
"code": "test_code",
"codeIsLiteral": true,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
}
]
},
"CallExprCodes": [
{
"name": "ErrEmptyConfig",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "config/error.go"
},
{
"name": "ErrNoneDatabase",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "database/error.go"
},
{
"name": "ErrEndpointNotFound",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrInvalidAPIServer",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/error.go"
},
{
"name": "ErrPodHasNoLabels",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrServiceHasNoSelectors",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrInvalidDeploymentNoSelectorsLabels",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrInvalidDeploymentNoSelectors",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrInvalidReplicaNoSelectorsLabels",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrInvalidReplicaSetNoSelectors",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
},
{
"name": "ErrNoPortsFoundForHeadlessResource",
"code": "",
"codeIsLiteral": false,
"codeIsInt": false,
"path": "utils/kubernetes/expose/error.go"
}
]
}
from meshkit.
Summary of analysis:
{
"minCode": 600,
"maxCode": 11001,
"duplicates": {
"11000": [
"ErrConnectCode",
"ErrEncodedConnCode"
],
"11001": [
"ErrPublishCode",
"ErrPublishRequestCode",
"ErrQueueSubscribeCode"
],
"kit_10205": [
"ErrUnmarshal",
"ErrMarshal",
"ErrGetBool"
],
"meshkit_test_code": [
"ErrExposeResourceCode",
"ErrGettingResourceCode",
"ErrTraverserCode",
"ErrResourceCannotBeExposedCode",
"ErrSelectorBasedMapCode",
"ErrProtocolBasedMapCode",
"ErrLableBasedMapCode",
"ErrPortParsingCode",
"ErrGenerateServiceCode",
"ErrConstructingRestHelperCode",
"ErrCreatingServiceCode"
],
"test": [
"ErrNoneDatabaseCode",
"ErrDatabaseOpenCode"
],
"test_code": [
"ErrApplyManifestCode",
"ErrServiceDiscoveryCode",
"ErrApplyHelmChartCode",
"ErrNewKubeClientCode",
"ErrNewDynClientCode",
"ErrNewDiscoveryCode",
"ErrNewInformerCode",
"ErrEndpointNotFoundCode",
"ErrInvalidAPIServerCode"
]
},
"intCodes": [
700,
1001,
1003,
1004,
1005,
11000,
11000,
1002,
1000,
1006,
600,
702,
1007,
601,
1008,
701,
11001,
11001,
11001,
602,
1009
]
}
from meshkit.
Yes this looks fantastic. Lets checkout the code after our meet, so that we are in sync. @mgfeller
from meshkit.
Sample of latest summary (for meshkit
):
{
"min_code": 600,
"max_code": 11001,
"duplicates": {
"11000": [
"ErrConnectCode",
"ErrEncodedConnCode"
],
"11001": [
"ErrPublishCode",
"ErrPublishRequestCode",
"ErrQueueSubscribeCode"
],
"kit_10205": [
"ErrUnmarshal",
"ErrMarshal",
"ErrGetBool"
],
"meshkit_test_code": [
"ErrExposeResourceCode",
"ErrGettingResourceCode",
"ErrTraverserCode",
"ErrResourceCannotBeExposedCode",
"ErrSelectorBasedMapCode",
"ErrProtocolBasedMapCode",
"ErrLableBasedMapCode",
"ErrPortParsingCode",
"ErrGenerateServiceCode",
"ErrConstructingRestHelperCode",
"ErrCreatingServiceCode"
],
"test": [
"ErrNoneDatabaseCode",
"ErrDatabaseOpenCode"
],
"test_code": [
"ErrApplyManifestCode",
"ErrServiceDiscoveryCode",
"ErrApplyHelmChartCode",
"ErrNewKubeClientCode",
"ErrNewDynClientCode",
"ErrNewDiscoveryCode",
"ErrNewInformerCode",
"ErrEndpointNotFoundCode",
"ErrInvalidAPIServerCode"
]
},
"call_expr_codes": [
"ErrEmptyConfig",
"ErrNoneDatabase",
"ErrEndpointNotFound",
"ErrInvalidAPIServer",
"ErrPodHasNoLabels",
"ErrServiceHasNoSelectors",
"ErrInvalidDeploymentNoSelectorsLabels",
"ErrInvalidDeploymentNoSelectors",
"ErrInvalidReplicaNoSelectorsLabels",
"ErrInvalidReplicaSetNoSelectors",
"ErrNoPortsFoundForHeadlessResource"
],
"int_codes": [
11000,
1006,
702,
1004,
1005,
11001,
1001,
1002,
1007,
700,
1008,
1009,
600,
602,
701,
1000,
601,
1003
]
}
from meshkit.
Curious, what does it mean for error codes to be included in the “duplicates” section?
from meshkit.
Related Issues (20)
- Replace the Logo of Layer5 with Meshery in config.yml workflow HOT 8
- [Docs] Error links in readme HOT 3
- [CI] GitHub Workflow needs updated to not use `set-env` HOT 4
- [CI] Add Failure Notification to Go Mod Syncer Workflow
- Additional caveats of go mod syncer HOT 2
- Schema for Meshery Events HOT 2
- [chore] update Go to 1.21, and update relevant pkgs HOT 8
- [Helm Repo Schema] Please include standard field validation for a URL. HOT 4
- [Documentation] update the CONTRIBUTING.md with Issues & Pull Requests sections HOT 3
- [Meshery Models] Create SubCategories
- [CI] Fix lint issues HOT 8
- [Security issue] for all the projects are imported mesh kit
- After finalising on where to keep dictionary.json, use that file to initialize dict map in init() HOT 2
- The test cases are supported to running in parallel HOT 3
- Go module build failed
- [CI] Workflow to validate the compatibility of MeshKit with Meshery Server HOT 3
- [Chore] Lint check failures HOT 1
- [CI] Add Label Commenter
- [CI] Methodology to test MeshKit builds HOT 3
- [Chore] Golang Test Failure: Compose HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshkit.