refactor: standardize error handling with exception.Builder
- Replace hardcoded error messages with structured error codes using exception.Builder. - Introduce new common error constants in exception/common.go (CommonErrorInvalidInput, CommonErrorUserNotFound, etc.). - Update exception/specific.go with domain-specific errors and remove redundant ones. - Apply consistent error handling across auth, event, user services and middleware. Co-authored-by: Gemini <gemini@google.com> Signed-off-by: Noa Virellia <noa@requiem.garden>
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
package exception
|
||||
|
||||
const (
|
||||
CommonErrorInvalidInput = "00001"
|
||||
CommonErrorUnauthorized = "00002"
|
||||
CommonErrorInvalidInput = "00001"
|
||||
CommonErrorUnauthorized = "00002"
|
||||
CommonErrorInternal = "00003"
|
||||
CommonErrorPermissionDenied = "00004"
|
||||
CommonErrorUuidParseFailed = "00005"
|
||||
CommonErrorDatabase = "00006"
|
||||
CommonErrorMissingUserId = "00007"
|
||||
CommonErrorUserNotFound = "00008"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user