Skip to content

Define error codes and reuse #384

@malinthaprasan

Description

@malinthaprasan

Description

Refactor all errors in platform-api/src/internal/constants/error.go

eg:

type APIError struct {
    Code    string
    Message string
}

func (e *APIError) Error() string {
    return e.Message
}

// Define as variables
var (
    ErrAPIIdentifierExists = &APIError{Code: "API_IDENTIFIER_EXISTS", Message: "API identifier already exists"}
    ErrAPINameVersionExists = &APIError{Code: "API_NAME_VERSION_EXISTS", Message: "API name and version combination already exists"}
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area/ManagementAny issues related to Management API or Management Portal UISeverity/Major

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions