-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently, our error handling and response patterns are inconsistent across the backend.
There are multiple variations of JSON response structures (error, msg, data), unstructured error types, and missing standardized codes — making it difficult for both the frontend and logs to correlate issues.
This issue aims to standardize error handling, formatting, and propagation across the entire API layer using idiomatic Go and industry best practices.
Current Problems
APIError.Error()returns an empty string — breaks logging and error wrapping.- Multiple
JoinErrorfunctions cause confusion and message inconsistencies. - Different response keys across endpoints (
error,msg,data). - Internal errors (e.g.,
gorm.ErrRecordNotFound) are leaked to clients. - No consistent
codefield for frontend error mapping. - Pagination responses have a different format from others.
- No centralized middleware for unified error handling and logging.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request