Documentation
¶
Index ¶
- Constants
- func Cause(err error) error
- func Code(err error) int
- func E0001(sheetName, bookName string) error
- func E0002(filename, messageName, errstr string, lines string) error
- func E1000(name, positon1, positon2 string) error
- func E2000(typ, value string, min, max any) error
- func E2001(refer string, messageName string) error
- func E2002(value string, refer string) error
- func E2003(value string, sequence int64) error
- func E2004(value any, vrange string) error
- func E2005(key any) error
- func E2006(value, enumName any) error
- func E2007(value, err any) error
- func E2008(value, err any) error
- func E2009(key, fieldName any) error
- func E2010(typeValue, fieldNumber any) error
- func E2011() error
- func E2012(fieldType, value any, err error) error
- func E2013(value any, err error) error
- func E2014(column string) error
- func E2015(column, bookName, sheetName string) error
- func E2016(firstNonePresentIndex, nextPresentIndex int) error
- func E2017(mapType string) error
- func E2018(keyName string) error
- func E2019(value string, err error) error
- func E2020(value string, err error) error
- func E2021(enumType, enumValue1, enumValue2, alias any) error
- func E3000(sheetSpecifier, pattern string) error
- func E3001(sheetName, bookName string) error
- func ErrorKV(msg string, keysAndValues ...any) error
- func Errorf(format string, args ...interface{}) error
- func Is(err error, code int) bool
- func New(code int) error
- func NewStackless(code int) error
- func WithCode(err error, code int) error
- func WithCodef(err error, code int, format string, args ...interface{}) error
- func Wrap(err error) error
- func WrapKV(err error, keysAndValues ...any) error
- func Wrapf(err error, format string, args ...interface{}) error
- type Desc
- type Error
- type Frame
- type StackTrace
Constants ¶
const ( ModuleDefault = "default" ModuleProto = "protogen" ModuleConf = "confgen" )
const ( // The String method processing logic of Desc is dependent on this key's corresponding value. // module: default, proto, conf. KeyModule = "Module" KeyIndir = "Indir" // input dir KeySubdir = "Subdir" // input subdir KeyOutdir = "Outdir" // output dir KeyBookName = "BookName" // workbook name KeyPrimaryBookName = "PrimaryBookName" // primary workbook name KeySheetName = "SheetName" // worksheet name KeyPrimarySheetName = "PrimarySheetName" // primary worksheet name KeyNameCellPos = "NameCellPos" // name cell position KeyNameCell = "NameCell" // name cell value KeyTrimmedNameCell = "TrimmedNameCell" // trimmed name cell value KeyTypeCellPos = "TypeCellPos" // type cell position KeyTypeCell = "TypeCell" // type cell value KeyDataCellPos = "DataCellPos" // data cell position KeyDataCell = "DataCell" // data data value KeyPBMessage = "PBMessage" // protobuf message name KeyPBFieldName = "PBFieldName" // protobuf message field name KeyPBFieldType = "PBFieldType" // protobuf message field type KeyPBFieldOpts = "PBFieldOpts" // protobuf message field options (extensions) KeyColumnName = "ColumnName" // column name KeyReason = "Reason" // error )
desc keys for bookkeeping
Variables ¶
This section is empty.
Functions ¶
func E2011 ¶ added in v0.11.0
func E2011() error
E2011: field presence required but cell not filled.
func ErrorKV ¶
ErrorKV returns an error with the supplied message and the key-value pairs as `[|key: value]...` string. ErrorKV also records the stack trace at the point it was called.
func Errorf ¶
Errorf formats according to a format specifier and returns the string as a value that satisfies error. Errorf also records the code and stack trace at the point it was called. func Errorf(code int, format string, args ...interface{}) error {
func New ¶ added in v0.12.0
New returns an error with the supplied code and message. New also records the stack trace at the point it was called
func NewStackless ¶ added in v0.12.0
NewStackless returns an error without caller stack.
func Wrap ¶ added in v0.12.0
Wrap annotates err with a stack trace at the point Wrap was called. If err is nil, Wrap returns nil.
Types ¶
type Desc ¶
type Desc struct {
// contains filtered or unexported fields
}
func (*Desc) DebugString ¶
type Frame ¶ added in v0.12.0
type Frame uintptr
Frame represents a program counter inside a stack frame. For historical reasons if Frame is interpreted as a uintptr its value represents the program counter + 1.
func (Frame) Format ¶ added in v0.12.0
Format formats the frame according to the fmt.Formatter interface.
%s source file %d source line %n function name %v equivalent to %s:%d
Format accepts flags that alter the printing of some verbs, as follows:
%+s function name and path of source file relative to the compile time GOPATH separated by \n\t (<funcname>\n\t<path>) %+v equivalent to %+s:%d
func (Frame) MarshalText ¶ added in v0.12.0
MarshalText formats a stacktrace Frame as a text string. The output is the same as that of fmt.Sprintf("%+v", f), but without newlines or tabs.
type StackTrace ¶ added in v0.12.0
type StackTrace []Frame
StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
func (StackTrace) Format ¶ added in v0.12.0
func (st StackTrace) Format(s fmt.State, verb rune)
Format formats the stack of Frames according to the fmt.Formatter interface.
%s lists source files for each Frame in the stack %v lists the source file and line number for each Frame in the stack
Format accepts flags that alter the printing of some verbs, as follows:
%+v Prints filename, function, and line number for each Frame in the stack.