@@ -3,19 +3,20 @@ package e
33import "net/http"
44
55var messages = map [ErrorCode ]string {
6- ErrorCodeConfigParseError : "The configuration is invalid." ,
7- ErrorCodeDeploymentConflict : "The conflict occurs, please retry." ,
8- ErrorCodeDeploymentInvalid : "The validation has failed." ,
9- ErrorCodeDeploymentLocked : "The environment is locked." ,
10- ErrorCodeDeploymentNotApproved : "The deployment is not approved" ,
11- ErrorCodeDeploymentUndeployable : "There is merge conflict or a commit status check failed." ,
12- ErrorCodeLicenseDecode : "Decoding the license is failed." ,
13- ErrorCodeLicenseRequired : "The license is required." ,
14- ErrorCodeInvalidRequest : "Invalid request parameter." ,
15- ErrorPermissionRequired : "The permission is required" ,
16- ErrorCodeNotFound : "It is not found." ,
17- ErrorCodeUnprocessableEntity : "Invalid request payload." ,
18- ErrorCodeInternalError : "Server internal error." ,
6+ ErrorCodeConfigParseError : "The configuration is invalid." ,
7+ ErrorCodeDeploymentConflict : "The conflict occurs, please retry." ,
8+ ErrorCodeDeploymentInvalid : "The validation has failed." ,
9+ ErrorCodeDeploymentLocked : "The environment is locked." ,
10+ ErrorCodeDeploymentNotApproved : "The deployment is not approved" ,
11+ ErrorCodeDeploymentStatusInvalid : "The deployment status is invalid" ,
12+ ErrorCodeDeploymentUndeployable : "There is merge conflict or a commit status check failed." ,
13+ ErrorCodeLicenseDecode : "Decoding the license is failed." ,
14+ ErrorCodeLicenseRequired : "The license is required." ,
15+ ErrorCodeInvalidRequest : "Invalid request parameter." ,
16+ ErrorPermissionRequired : "The permission is required" ,
17+ ErrorCodeNotFound : "It is not found." ,
18+ ErrorCodeUnprocessableEntity : "Invalid request payload." ,
19+ ErrorCodeInternalError : "Server internal error." ,
1920}
2021
2122func GetMessage (code ErrorCode ) string {
@@ -28,19 +29,20 @@ func GetMessage(code ErrorCode) string {
2829}
2930
3031var httpCodes = map [ErrorCode ]int {
31- ErrorCodeConfigParseError : http .StatusUnprocessableEntity ,
32- ErrorCodeDeploymentConflict : http .StatusUnprocessableEntity ,
33- ErrorCodeDeploymentInvalid : http .StatusUnprocessableEntity ,
34- ErrorCodeDeploymentLocked : http .StatusUnprocessableEntity ,
35- ErrorCodeDeploymentNotApproved : http .StatusUnprocessableEntity ,
36- ErrorCodeDeploymentUndeployable : http .StatusUnprocessableEntity ,
37- ErrorCodeLicenseDecode : http .StatusUnprocessableEntity ,
38- ErrorCodeLicenseRequired : http .StatusPaymentRequired ,
39- ErrorCodeInvalidRequest : http .StatusBadRequest ,
40- ErrorCodeNotFound : http .StatusNotFound ,
41- ErrorPermissionRequired : http .StatusForbidden ,
42- ErrorCodeUnprocessableEntity : http .StatusUnprocessableEntity ,
43- ErrorCodeInternalError : http .StatusInternalServerError ,
32+ ErrorCodeConfigParseError : http .StatusUnprocessableEntity ,
33+ ErrorCodeDeploymentConflict : http .StatusUnprocessableEntity ,
34+ ErrorCodeDeploymentInvalid : http .StatusUnprocessableEntity ,
35+ ErrorCodeDeploymentLocked : http .StatusUnprocessableEntity ,
36+ ErrorCodeDeploymentNotApproved : http .StatusUnprocessableEntity ,
37+ ErrorCodeDeploymentStatusInvalid : http .StatusUnprocessableEntity ,
38+ ErrorCodeDeploymentUndeployable : http .StatusUnprocessableEntity ,
39+ ErrorCodeLicenseDecode : http .StatusUnprocessableEntity ,
40+ ErrorCodeLicenseRequired : http .StatusPaymentRequired ,
41+ ErrorCodeInvalidRequest : http .StatusBadRequest ,
42+ ErrorCodeNotFound : http .StatusNotFound ,
43+ ErrorPermissionRequired : http .StatusForbidden ,
44+ ErrorCodeUnprocessableEntity : http .StatusUnprocessableEntity ,
45+ ErrorCodeInternalError : http .StatusInternalServerError ,
4446}
4547
4648func GetHttpCode (code ErrorCode ) int {
0 commit comments