Define error codes and reuse
Open
Nobody has claimed this yet.
Area/Management
Severity/Major
- Dominant language
- Go
- Stars
- 71
- Forks
- 111
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 110
Description
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"}
)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with platform-api/src/internal/constants/error.go and review the existing error definitions and their usages. Define reusable API errors with codes and messages consistently, then verify that the platform API references the shared errors rather than duplicating them.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100