Files
honoka-chan/internal/schema/common/common.go
T
YumeMichi 0dd5df0302 Unify fallback and unimplemented API error handling
- Add a shared common error response schema and unknown error code for business-level fallbacks
- Return business error payloads for router NoRoute and NoMethod fallbacks
- Align the existing event list fallback response with the shared error structure
- Introduce an explicit unimplemented API error type instead of relying on formatted strings
- Make /api batch dispatch return per-item status 600 error entries for unimplemented modules and actions without failing the whole batch

Signed-off-by: Sean Du <do4suki@gmail.com>
2026-06-06 17:13:27 +08:00

23 lines
497 B
Go

package commonschema
import (
"honoka-chan/internal/constant"
)
type ErrorData struct {
ErrorCode constant.ErrorCode `json:"error_code"`
}
type ErrorResp struct {
ResponseData ErrorData `json:"response_data"`
ReleaseInfo []any `json:"release_info"`
StatusCode int `json:"status_code"`
}
type ApiErrorResp struct {
Result ErrorData `json:"result"`
Status int `json:"status"`
CommandNum bool `json:"commandNum"`
TimeStamp int64 `json:"timeStamp"`
}