Documentation ¶
Index ¶
- Constants
- func AppendTypedErrorMessages(errorMessage map[string]ErrorMessage)
- func GetArgsString(args ...interface{}) (argsStr string)
- func GetTrace() string
- func GetTypedMess(key string, args ...interface{}) (code string, text string)
- func SetTypedErrorMessages(errorMessage map[string]ErrorMessage)
- type Error
- func New(code string, msg string, args ...interface{}) *Error
- func NewTyped(key string, externalId uint64, args ...interface{}) *Error
- func WithCause(code string, msg string, causeErr error, args ...interface{}) *Error
- func WithCauseTyped(key string, externalId uint64, causeErr error, args ...interface{}) *Error
- type ErrorMessage
Constants ¶
View Source
const ERR_COMMON_ERROR = "COMMON_ERROR"
View Source
const ERR_CONFIG_FILE_LOAD_ERROR = "CONFIG_FILE_LOAD_ERROR"
View Source
const ERR_CONFIG_FILE_NOT_EXISTS = "CONFIG_FILE_NOT_EXISTS"
View Source
const ERR_CONTEXT_CLOSED_ERROR = "CONTEXT_CLOSED_ERROR"
View Source
const ERR_DB_CLOSE_ERROR = "DB_CLOSE_ERROR"
View Source
const ERR_DB_CONNECTION_ERROR = "DB_CONNECTION_ERROR"
View Source
const ERR_DB_EXEC_ERROR = "DB_EXEC_ERROR"
View Source
const ERR_DB_EXEC_ROW_COUNT_ERROR = "DB_EXEC_ROW_COUNT_ERROR"
View Source
const ERR_DB_GET_ERROR = "DB_GET_ERROR"
View Source
const ERR_DB_QUERYROWX_ERROR = "DB_QUERYROWX_ERROR"
View Source
const ERR_DB_SELECT_ERROR = "DB_SELECT_ERROR"
View Source
const ERR_DB_SQL_STM_NOT_DEFINED_ERROR = "DB_SQL_STM_NOT_DEFINED_ERROR"
View Source
const ERR_DB_SQL_STM_PREPARE_ERROR = "DB_SQL_STM_PREPARE_ERROR"
View Source
const ERR_DB_TOO_MANY_ROWS_ERROR = "DB_TOO_MANY_ROWS_ERROR"
View Source
const ERR_DB_TX_COMMIT_ERROR = "DB_TX_COMMIT_ERROR"
View Source
const ERR_DB_TX_CREATE_ERROR = "DB_TX_CREATE_ERROR"
View Source
const ERR_DB_TX_NOT_DEFINED_ERROR = "DB_TX_NOT_DEFINED_ERROR"
View Source
const ERR_DB_TX_ROLLBAK_ERROR = "DB_TX_ROLLBAK_ERROR"
View Source
const ERR_EMPTY_CONFIG_FILE = "EMPTY_CONFIG_FILE"
View Source
const ERR_EMPTY_HTTP_USER = "EMPTY_HTTP_USER"
View Source
const ERR_EMPTY_JWT_KEY = "EMPTY_JWT_KEY"
View Source
const ERR_ERROR = "ERROR"
View Source
const ERR_FILE_OPEN_ERROR = "FILE_OPEN_ERROR"
View Source
const ERR_FILE_SYNC_ERROR = "FILE_SYNC_ERROR"
View Source
const ERR_HTTP_AUTH_BASIC_ERROR = "HTTP_AUTH_BASIC_ERROR"
View Source
const ERR_HTTP_AUTH_BASIC_NOT_SET_ERROR = "HTTP_AUTH_BASIC_NOT_SET_ERROR"
View Source
const ERR_HTTP_AUTH_JWT_EXPIRED_ERROR = "HTTP_AUTH_JWT_EXPIRED_ERROR"
View Source
const ERR_HTTP_AUTH_JWT_INVALID_ERROR = "HTTP_AUTH_JWT_INVALID_ERROR"
View Source
const ERR_HTTP_AUTH_JWT_NOT_SET_ERROR = "HTTP_AUTH_JWT_NOT_SET_ERROR"
View Source
const ERR_HTTP_AUTH_MSAD_ERROR = "HTTP_AUTH_MSAD_ERROR"
View Source
const ERR_HTTP_AUTH_MSAD_INVALID_ERROR = "HTTP_AUTH_MSAD_INVALID_ERROR"
View Source
const ERR_HTTP_BODY_READ_ERROR = "HTTP_BODY_READ_ERROR"
View Source
const ERR_HTTP_CALL_CREATE_CONTEXT_ERROR = "HTTP_CALL_CREATE_CONTEXT_ERROR"
View Source
const ERR_HTTP_CALL_EMPTY_URL = "HTTP_CALL_EMPTY_URL"
View Source
const ERR_HTTP_CALL_METHOD_NOT_ALLOWED_ERROR = "HTTP_CALL_METHOD_NOT_ALLOWED_ERROR"
View Source
const ERR_HTTP_CALL_OTHER_ERROR = "HTTP_CALL_OTHER_ERROR"
View Source
const ERR_HTTP_CALL_OTHER_NETURL_ERROR = "HTTP_CALL_OTHER_NETURL_ERROR"
View Source
const ERR_HTTP_CALL_READ_BODY_ERROR = "HTTP_CALL_READ_BODY_ERROR"
View Source
const ERR_HTTP_CALL_TIMEOUT_ERROR = "HTTP_CALL_TIMEOUT_ERROR"
View Source
const ERR_HTTP_CALL_URL_NOT_FOUND_ERROR = "HTTP_CALL_URL_NOT_FOUND_ERROR"
View Source
const ERR_HTTP_DUMP_REQUEST_ERROR = "HTTP_DUMP_REQUEST_ERROR"
View Source
const ERR_HTTP_HANDLER_METHOD_NOT_FOUND = "HTTP_HANDLER_METHOD_NOT_FOUND"
View Source
const ERR_HTTP_HEADER_INCORRECT_BOOL = "HTTP_HEADER_INCORRECT_BOOL"
View Source
const ERR_HTTP_LISTENER_CREATE_ERROR = "HTTP_LISTENER_CREATE_ERROR"
View Source
const ERR_HTTP_METHOD_NOT_ALLOWED_ERROR = "HTTP_METHOD_NOT_ALLOWED_ERROR"
View Source
const ERR_HTTP_REQUEST_WRITE_ERROR = "HTTP_REQUEST_WRITE_ERROR"
View Source
const ERR_HTTP_SERVER_SHUTDOWN_ERROR = "HTTP_SERVER_SHUTDOWN_ERROR"
View Source
const ERR_INCORRECT_ARG_NUM_ERROR = "INCORRECT_ARG_NUM_ERROR"
View Source
const ERR_INCORRECT_AUTH_TYPE = "INCORRECT_AUTH_TYPE"
View Source
const ERR_INCORRECT_CALL_ERROR = "INCORRECT_CALL_ERROR"
View Source
const ERR_INCORRECT_ENTITY_SOURCE = "INCORRECT_ENTITY_SOURCE"
View Source
const ERR_INCORRECT_LOG_LEVEL = "INCORRECT_LOG_LEVEL"
View Source
const ERR_INCORRECT_TYPE_ERROR = "INCORRECT_TYPE_ERROR"
View Source
const ERR_INT_PARSE_ERROR = "INT_PARSE_ERROR"
View Source
const ERR_JSON_MARSHAL_ERROR = "JSON_MARSHAL_ERROR"
View Source
const ERR_JSON_UNMARSHAL_ERROR = "JSON_UNMARSHAL_ERROR"
View Source
const ERR_MESSAGE_NOT_FOUND = "MESSAGE_NOT_FOUND"
View Source
const ERR_PANIC_RECOVER_ERROR = "PANIC_RECOVER_ERROR"
View Source
const ERR_REFLECT_INCORRECT_TYPE = "REFLECT_INCORRECT_TYPE"
View Source
const ERR_TIMEOUT_ERROR = "TIMEOUT_ERROR"
View Source
const ERR_TIME_FORMAT_ERROR = "TIME_FORMAT_ERROR"
View Source
const ERR_UNDEFINED_ID = uint64(0)
View Source
const ERR_VALIDATOR_COMMON_ERROR = "VALIDATOR_COMMON_ERROR"
View Source
const ERR_VALIDATOR_MDG_ERROR = "VALIDATOR_MDG_ERROR"
View Source
const ERR_VALIDATOR_STRUCT_ERROR = "VALIDATOR_STRUCT_ERROR"
View Source
const ERR_WORKER_POOL_ADD_TASK_INCORRECT_STATE = "WORKER_POOL_ADD_TASK_INCORRECT_STATE"
View Source
const ERR_WORKER_POOL_ALREADY_LOCKED = "WORKER_POOL_ALREADY_LOCKED"
View Source
const ERR_WORKER_POOL_CONTEXT_CLOSED = "WORKER_POOL_CONTEXT_CLOSED"
View Source
const ERR_WORKER_POOL_INCOMPLETE_DONE = "WORKER_POOL_INCOMPLETE_DONE"
View Source
const ERR_WORKER_POOL_IS_SHUTTING_DOWN = "WORKER_POOL_IS_SHUTTING_DOWN"
View Source
const ERR_WORKER_POOL_RUN_INCORRECT_STATE = "WORKER_POOL_RUN_INCORRECT_STATE"
View Source
const ERR_WORKER_POOL_STOP_SIGNAL = "WORKER_POOL_STOP_SIGNAL"
View Source
const ERR_WORKER_POOL_TASK_ALREADY_LOCKED = "WORKER_POOL_TASK_ALREADY_LOCKED"
View Source
const ERR_WORKER_POOL_TASK_CHANNEL_CLOSED = "WORKER_POOL_TASK_CHANNEL_CLOSED"
View Source
const ERR_WORKER_POOL_TASK_COUNT_ERROR = "WORKER_POOL_TASK_COUNT_ERROR"
View Source
const ERR_WORKER_POOL_TASK_INCORRECT_STATE = "WORKER_POOL_TASK_INCORRECT_STATE"
View Source
const ERR_WORKER_POOL_TIMEOUT_ERROR = "WORKER_POOL_TIMEOUT_ERROR"
View Source
const ERR_WORKER_POOL_WORKER_ERROR = "WORKER_POOL_WORKER_ERROR"
View Source
const ERR_XLSX_COMMON_ERROR = "XLSX_COMMON_ERROR"
View Source
const ERR_XML_MARSHAL_ERROR = "XML_MARSHAL_ERROR"
View Source
const ERR_XML_UNMARSHAL_ERROR = "XML_UNMARSHAL_ERROR"
View Source
const ERR_YAML_MARSHAL_ERROR = "YAML_MARSHAL_ERROR"
View Source
const ERR_YAML_UNMARSHAL_ERROR = "YAML_UNMARSHAL_ERROR"
Variables ¶
This section is empty.
Functions ¶
func AppendTypedErrorMessages ¶
func AppendTypedErrorMessages(errorMessage map[string]ErrorMessage)
AppendTypedErrorMessages - добавить сообщения в набор сообщений об ошибках
func GetArgsString ¶
func GetArgsString(args ...interface{}) (argsStr string)
GetArgsString return formated string with arguments
func GetTypedMess ¶
GetTypedMess Добавить типизированное сообщение
func SetTypedErrorMessages ¶
func SetTypedErrorMessages(errorMessage map[string]ErrorMessage)
SetTypedErrorMessages - установить набор сообщений об ошибках
Types ¶
type Error ¶
type Error struct { ID uint64 `json:"id,omitempty"` // уникальный номер ошибки ExternalId uint64 `json:"external_id,omitempty"` // внешний ID, который был передан при создании ошибки Code string `json:"code,omitempty"` // код ошибки Message string `json:"message,omitempty"` // текст ошибки Details []string `json:"details,omitempty"` // текст ошибки подробный Caller string `json:"caller,omitempty"` // файл, строка и наименование метода в котором произошла ошибка Args string `json:"args,omitempty"` // строка аргументов CauseMessage string `json:"cause_message,omitempty"` // текст ошибки - причины CauseErr error `json:"cause_err,omitempty"` // ошибка - причина Trace string `json:"trace,omitempty"` // стек вызова }
Error represent custom error
func WithCauseTyped ¶
WithCauseTyped - create new custom error with cause
func (*Error) Format ¶
Format output
%s print the error code, message, arguments, and cause message. %v in addition to %s, print caller %+v extended format. Each Frame of the error's StackTrace will be printed in detail.
func (*Error) PrintfDebug ¶
PrintfDebug print custom error
func (*Error) PrintfError ¶
PrintfError print custom error
func (*Error) PrintfInfo ¶
PrintfInfo print custom error
type ErrorMessage ¶
ErrorMessage Сообщения
Click to show internal directories.
Click to hide internal directories.