errors

package
v0.2.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	API_CODE_SUCCESS = 0 // API_CODE_SUCCESS indicates the request was processed successfully.
	API_CODE_FAILED  = 1 // API_CODE_FAILED indicates the request failed.
)

API response code constants used as the top-level status indicator in JSON responses.

Variables

View Source
var (
	// ErrorNotFound is returned when the requested resource does not exist.
	ErrorNotFound = &dto.ResponseMessage{Code: 404, Message: "record not found", Data: nil}
	// ErrorNoToken is returned when no token is present in the request.
	ErrorNoToken = &dto.ResponseMessage{Code: 400, Message: "token does not define", Data: nil}
	// ErrorBadToken is returned when the provided token is malformed or invalid.
	ErrorBadToken = &dto.ResponseMessage{Code: 400, Message: "token error", Data: nil}
	// ErrorExpiredToken is returned when the provided token has expired.
	ErrorExpiredToken = &dto.ResponseMessage{Code: 401, Message: "token expired", Data: nil}
	// ErrorPermissionToken is returned when the token lacks the required permission.
	ErrorPermissionToken = &dto.ResponseMessage{Code: 403, Message: "token has no permission", Data: nil}
	// ErrorInternalServer is returned for unexpected server-side errors.
	ErrorInternalServer = &dto.ResponseMessage{Code: 500, Message: "internal server error", Data: nil}
	// ErrorDatabase is returned when a database operation fails.
	ErrorDatabase = &dto.ResponseMessage{Code: 500, Message: "database error", Data: nil}
	// ErrorVersionConflict is returned when an update carries a stale version:
	// another user has saved a change to the same field since this caller last
	// read it. Defined here because infra/dao must be able to
	// return it too, and infra/dao cannot import service. Callers compare via
	// err.Error() == ErrorVersionConflict.Message, matching the existing
	// errorcode.ErrorNotFound.Message convention used across adapter/infra/dao.
	ErrorVersionConflict = &dto.ResponseMessage{Code: 409, Message: "content has been modified", Data: nil}
)

Pre-defined ResponseMessage error values for common token and server errors.

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL