File size: 720 Bytes
2e6b65c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package dto

// ErrorResponse is the standardized error response for clients
type ErrorResponse struct {
	Success   bool      `json:"success" example:"false"`
	Error     ErrorInfo `json:"error"`
	RequestID string    `json:"request_id,omitempty"`
}

type ErrorInfo struct {
	Code    string                 `json:"code" example:"AUTH_INVALID_CREDENTIALS"`
	Message string                 `json:"message" example:"Invalid credentials provided"`
	Details map[string]interface{} `json:"details,omitempty"`
}

// InternalErrorResponse is returned for 500 errors (no sensitive info)
type InternalErrorResponse struct {
	Success   bool   `json:"success"`
	Error     string `json:"error"`
	RequestID string `json:"request_id"`
}