2024-06-20 12:14:46 +05:30
|
|
|
package prime_api
|
|
|
|
|
|
|
|
|
|
type ErrorCode int
|
|
|
|
|
|
|
|
|
|
const (
|
|
|
|
|
NO_ERROR ErrorCode = iota
|
|
|
|
|
UNABLE_TO_POST_SERVICE_STATUS
|
2024-08-22 17:39:19 +05:30
|
|
|
UNABLE_TO_GET_FEATURE_FLAGS
|
|
|
|
|
UNABLE_TO_ACTIVATE_WORKSPACE
|
|
|
|
|
UNABLE_TO_PARSE_FEATURE_FLAGS
|
|
|
|
|
UNABLE_TO_SYNC_WORKSPACE
|
2024-09-02 15:28:43 +05:30
|
|
|
UNABLE_TO_UPDATE_SEATS
|
|
|
|
|
UNABLE_TO_FETCH_WORKSPACE_SUBSCRIPTION
|
2024-09-17 13:03:54 +05:30
|
|
|
UNABLE_TO_RETRIEVE_PLANS
|
|
|
|
|
UNABLE_TO_PARSE_PLANS
|
2024-10-03 17:28:18 +05:30
|
|
|
UNABLE_TO_DEACTIVATE_LICENSE
|
2024-06-20 12:14:46 +05:30
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var errorCodeMap = map[ErrorCode]string{
|
2024-09-02 15:28:43 +05:30
|
|
|
NO_ERROR: "",
|
|
|
|
|
UNABLE_TO_POST_SERVICE_STATUS: "Unable to post service status",
|
|
|
|
|
UNABLE_TO_GET_FEATURE_FLAGS: "Unable to get feature flags",
|
|
|
|
|
UNABLE_TO_PARSE_FEATURE_FLAGS: "Unable to parse feature flags",
|
|
|
|
|
UNABLE_TO_ACTIVATE_WORKSPACE: "Unable to activate workspace, please check the logs",
|
|
|
|
|
UNABLE_TO_SYNC_WORKSPACE: "Unable to sync workspace, please check the logs",
|
|
|
|
|
UNABLE_TO_UPDATE_SEATS: "Unable to update seats for the license subscription",
|
|
|
|
|
UNABLE_TO_FETCH_WORKSPACE_SUBSCRIPTION: "Unable to fetch workspace subscription",
|
2024-09-17 13:03:54 +05:30
|
|
|
UNABLE_TO_RETRIEVE_PLANS: "Unable to retrieve plans",
|
|
|
|
|
UNABLE_TO_PARSE_PLANS: "Unable to parse plans",
|
2024-10-03 17:28:18 +05:30
|
|
|
UNABLE_TO_DEACTIVATE_LICENSE: "Unable to activate license",
|
2024-06-20 12:14:46 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Converting the Error Code type to confirm to the stringer interface to be
|
|
|
|
|
// used in error messages and print statements, ;)
|
|
|
|
|
func (code ErrorCode) String() string {
|
|
|
|
|
return errorCodeMap[code]
|
|
|
|
|
}
|