Documentation
¶
Index ¶
- Variables
- func CombineErrorAndMessageToError(err error, msg string) error
- func CombineErrorsToSingle(errItems ...error) error
- func CombineErrorsToSingleString(separator string, errItems ...error) string
- func ReferencesCompileString(joiner string, isIncludeQuote, isIncludeSingleQuote bool, ...) string
- func ReferencesCsvStrings(isIncludeQuote, isIncludeSingleQuote bool, references ...interface{}) []string
- func SimpleReferencesCompile(errType errtype.Variation, references ...interface{}) string
- func SimpleReferencesCompileOptimized(errType errtype.Variation, references ...interface{}) string
- type Wrapper
- func CombineErrorsToSingleWrapper(errType errtype.Variation, errItems ...error) *Wrapper
- func Empty() Wrapper
- func EmptyPrint() Wrapper
- func EmptyPtr() *Wrapper
- func New(errType errtype.Variation) Wrapper
- func NewDirectory(error error) Wrapper
- func NewDirectoryPath(msg, path string) Wrapper
- func NewDirectoryPathPtr(msg, path string) *Wrapper
- func NewDirectoryPtr(error error) *Wrapper
- func NewEmptyPathPtr() *Wrapper
- func NewErrUsingAllParams(errType errtype.Variation, isPrintErrorType bool, err error, ...) Wrapper
- func NewErrUsingAllParamsPtr(errType errtype.Variation, isPrintErrorType bool, err error, ...) *Wrapper
- func NewError(err error) Wrapper
- func NewErrorPlusMsgUsingAllParamsPtr(errType errtype.Variation, isPrintErrorType bool, err error, message string, ...) *Wrapper
- func NewErrorPtr(err error) *Wrapper
- func NewErrorRef1(errType errtype.Variation, err error, var1 string, val1 interface{}) *Wrapper
- func NewFile(errType errtype.Variation, err error, filePath string) Wrapper
- func NewFilePath(msg, path string) Wrapper
- func NewFilePathPtr(msg, path string) *Wrapper
- func NewFilePtr(errType errtype.Variation, err error, filePath string) *Wrapper
- func NewFromDataModel(model *WrapperDataModel) *Wrapper
- func NewGeneric(error error) Wrapper
- func NewGenericPtr(error error) *Wrapper
- func NewMsgUsingAllParams(errType errtype.Variation, isPrintErrorType bool, message string, ...) Wrapper
- func NewMsgUsingAllParamsPtr(errType errtype.Variation, isPrintErrorType bool, message string, ...) *Wrapper
- func NewOnlyRefs(errType errtype.Variation, refValues ...ref.Value) *Wrapper
- func NewPath(errType errtype.Variation, error error, filePath string) *Wrapper
- func NewPathMessage(errType errtype.Variation, filePath string, messages ...string) *Wrapper
- func NewPtr(errType errtype.Variation) *Wrapper
- func NewRef(errType errtype.Variation, err error, varName string, val interface{}) *Wrapper
- func NewRef1(errType errtype.Variation, var1 string, val1 interface{}) *Wrapper
- func NewRef1Msg(errType errtype.Variation, msg string, var1 string, val1 interface{}) *Wrapper
- func NewRef2(errType errtype.Variation, error error, varName string, val interface{}, ...) *Wrapper
- func NewRef2Msg(errType errtype.Variation, msg string, var1 string, val1 interface{}, ...) *Wrapper
- func NewRefWithMessage(errType errtype.Variation, message string, refValues ...ref.Value) *Wrapper
- func NewRefs(errType errtype.Variation, error error, refValues ...ref.Value) *Wrapper
- func NewUnknownUsingMessage(msg string, isPrintErrorType bool) Wrapper
- func NewUnknownUsingMessagePtr(msg string, isPrintErrorType bool) *Wrapper
- func NewUsingError(errType errtype.Variation, err error) Wrapper
- func NewUsingErrorAndMessage(err error, msg string) *Wrapper
- func NewUsingErrorPtr(errType errtype.Variation, err error) *Wrapper
- func NewUsingErrorPtrErrorInPtr(errType errtype.Variation, err *error) *Wrapper
- func NewUsingErrorWithoutTypeDisplay(errType errtype.Variation, err error) Wrapper
- func NewUsingErrorWithoutTypeDisplayPtr(errType errtype.Variation, err error) *Wrapper
- func NewUsingMessage(errType errtype.Variation, message string) Wrapper
- func NewUsingMessagePtr(errType errtype.Variation, message string) *Wrapper
- func NewUsingSeparator(errType errtype.Variation, separator string, messages ...string) Wrapper
- func NewUsingSeparatorPtr(errType errtype.Variation, separator string, messages ...string) *Wrapper
- func NewUsingTypeErrorAndMessage(errType errtype.Variation, err error, msg string) *Wrapper
- func NewUsingWrapper(currentWrapper *Wrapper, additionalReferences ...ref.Value) *Wrapper
- func TypeReferenceQuick(errType errtype.Variation, referencesValues ...interface{}) *Wrapper
- func (it *Wrapper) AsErrorWrapper() *Wrapper
- func (it *Wrapper) AsJsonContractsBinder() corejson.JsonContractsBinder
- func (it *Wrapper) ClonePtr() *Wrapper
- func (it *Wrapper) CompiledError() error
- func (it *Wrapper) ConcatNew(err error) *Wrapper
- func (it *Wrapper) ConcatNewErrors(errItems ...error) *Wrapper
- func (it *Wrapper) ConcatNewMessage(errMsg string) *Wrapper
- func (it *Wrapper) ConcatNewMessageWithRef1(errMsg string, var1 string, val1 interface{}) *Wrapper
- func (it *Wrapper) ConcatNewMessageWithRef2(errMsg string, var1 string, val1 interface{}, var2 string, val2 interface{}) *Wrapper
- func (it *Wrapper) ConcatNewMessageWithRefs(errMsg string, references ...ref.Value) *Wrapper
- func (it *Wrapper) ConcatNewMessageWithRefsOnly(references ...ref.Value) *Wrapper
- func (it *Wrapper) ConcatNewMessages(funcName string, errMessages ...string) *Wrapper
- func (it *Wrapper) ConcatNewWrapperError(another *Wrapper) *Wrapper
- func (it *Wrapper) Error() error
- func (it *Wrapper) ErrorString() string
- func (it *Wrapper) FullOrErrorMessage(isErrorMessage bool) string
- func (it *Wrapper) FullString() string
- func (it *Wrapper) FullStringPtr() *string
- func (it *Wrapper) FullStringSplitByNewLine() []string
- func (it *Wrapper) GetTypeString() string
- func (it *Wrapper) GetTypeVariantStruct() errtype.VariantStructure
- func (it *Wrapper) GetTypeWithCodeString() string
- func (it *Wrapper) GetTypeWithCodeStringPtr() *string
- func (it *Wrapper) HandleError()
- func (it *Wrapper) HandleErrorWithMsg(newMessage string)
- func (it *Wrapper) HandleErrorWithRefs(newMessage string, refVar, refVal interface{})
- func (it *Wrapper) HasError() bool
- func (it *Wrapper) IsEmpty() bool
- func (it *Wrapper) IsEmptyError() bool
- func (it *Wrapper) IsEquals(another *Wrapper) bool
- func (it *Wrapper) IsErrorEquals(err error) bool
- func (it *Wrapper) IsErrorMessage(msg string, isCaseSensitive bool) bool
- func (it *Wrapper) IsErrorMessageContains(msg string, isCaseSensitive bool) bool
- func (it *Wrapper) IsErrorMessageEqual(msg string) bool
- func (it *Wrapper) IsFailed() bool
- func (it *Wrapper) IsReferencesEmpty() bool
- func (it *Wrapper) IsSuccess() bool
- func (it *Wrapper) IsTypeOf(errType errtype.Variation) bool
- func (it *Wrapper) IsValid() bool
- func (it *Wrapper) Json() *corejson.Result
- func (it *Wrapper) JsonModel() *WrapperDataModel
- func (it *Wrapper) JsonModelAny() interface{}
- func (it *Wrapper) JsonParseSelfInject(jsonResult *corejson.Result) error
- func (it *Wrapper) Log()
- func (it *Wrapper) LogErrorOnExist()
- func (it *Wrapper) LogErrorOnly()
- func (it *Wrapper) LogFatal()
- func (it *Wrapper) LogFatalOnExist()
- func (it *Wrapper) LogOnExist()
- func (it *Wrapper) MarshalJSON() ([]byte, error)
- func (it *Wrapper) ParseInjectUsingJson(jsonResult *corejson.Result) (*Wrapper, error)
- func (it *Wrapper) ParseInjectUsingJsonMust(jsonResult *corejson.Result) *Wrapper
- func (it *Wrapper) References() *refs.Collection
- func (it *Wrapper) SimpleErrorStringPtr() *string
- func (it *Wrapper) String() string
- func (it *Wrapper) Type() errtype.Variation
- func (it *Wrapper) TypeString() *string
- func (it *Wrapper) UnmarshalJSON(data []byte) error
- func (it *Wrapper) ValidationErrUsingTextValidator(validator *corevalidator.TextValidator, ...) *Wrapper
- func (it *Wrapper) Value() error
- type WrapperDataModel
Constants ¶
This section is empty.
Variables ¶
var ( StaticEmpty = Empty() StaticEmptyPtr = &StaticEmpty )
Functions ¶
func CombineErrorAndMessageToError ¶ added in v0.4.7
CombineErrorAndMessageToError final error is nil if err is nil
func CombineErrorsToSingle ¶ added in v0.4.7
CombineErrorsToSingle nil items will be ignored.
func CombineErrorsToSingleString ¶ added in v0.4.7
CombineErrorsToSingleString nil items will be ignored.
func ReferencesCompileString ¶ added in v0.7.0
func ReferencesCompileString( joiner string, isIncludeQuote, isIncludeSingleQuote bool, references ...interface{}, ) string
ReferencesCompileString
if references empty or len 0 then empty string returned.
Final join whole lines with the joiner given (... joiner item)
Formats :
- isIncludeQuote && isIncludeSingleQuote = '%v' will be added
- isIncludeQuote && !isIncludeSingleQuote = "'%v'" will be added
- !isIncludeQuote && !isIncludeSingleQuote = %v will be added
func ReferencesCsvStrings ¶ added in v0.7.0
func ReferencesCsvStrings( isIncludeQuote, isIncludeSingleQuote bool, references ...interface{}, ) []string
ReferencesCsvStrings
Formats :
- isIncludeQuote && isIncludeSingleQuote = '%v' will be added
- isIncludeQuote && !isIncludeSingleQuote = "'%v'" will be added
- !isIncludeQuote && !isIncludeSingleQuote = %v will be added
func SimpleReferencesCompile ¶ added in v0.7.0
func SimpleReferencesCompileOptimized ¶ added in v0.7.0
func SimpleReferencesCompileOptimized( errType errtype.Variation, references ...interface{}, ) string
SimpleReferencesCompileOptimized
errconsts.SimpleReferenceCompileOptimizedFormat = `%typeName (..., "reference")`
Types ¶
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
func CombineErrorsToSingleWrapper ¶ added in v0.4.7
CombineErrorsToSingleWrapper nil items will be ignored.
func EmptyPrint ¶ added in v0.0.4
func EmptyPrint() Wrapper
func NewDirectory ¶
func NewDirectoryPath ¶
func NewDirectoryPathPtr ¶ added in v0.3.9
func NewDirectoryPtr ¶ added in v0.3.9
func NewEmptyPathPtr ¶ added in v0.3.9
func NewEmptyPathPtr() *Wrapper
func NewErrUsingAllParams ¶
func NewErrUsingAllParamsPtr ¶
func NewErrorPlusMsgUsingAllParamsPtr ¶ added in v0.0.2
func NewErrorPtr ¶ added in v0.1.9
func NewErrorRef1 ¶ added in v0.6.5
NewErrorRef1 alias for NewRef
func NewFilePath ¶
func NewFilePathPtr ¶ added in v0.3.9
func NewFilePtr ¶ added in v0.3.9
func NewFromDataModel ¶ added in v0.4.0
func NewFromDataModel( model *WrapperDataModel, ) *Wrapper
func NewGeneric ¶
func NewGenericPtr ¶ added in v0.3.9
func NewMsgUsingAllParams ¶
func NewMsgUsingAllParamsPtr ¶
func NewOnlyRefs ¶ added in v0.5.2
func NewPathMessage ¶ added in v0.5.2
func NewRef1Msg ¶ added in v0.7.0
func NewRef2Msg ¶ added in v0.7.0
func NewRefWithMessage ¶ added in v0.5.2
func NewUnknownUsingMessage ¶
func NewUnknownUsingMessagePtr ¶ added in v0.3.9
func NewUsingErrorAndMessage ¶ added in v0.4.7
func NewUsingErrorPtrErrorInPtr ¶ added in v0.1.9
func NewUsingErrorWithoutTypeDisplayPtr ¶ added in v0.3.9
func NewUsingMessagePtr ¶ added in v0.1.9
func NewUsingSeparator ¶
func NewUsingSeparatorPtr ¶ added in v0.3.9
func NewUsingTypeErrorAndMessage ¶ added in v0.4.7
func NewUsingWrapper ¶ added in v0.5.4
func TypeReferenceQuick ¶ added in v0.7.0
TypeReferenceQuick - errorTypeName - (...., items)...
func (*Wrapper) AsErrorWrapper ¶ added in v0.7.3
func (*Wrapper) AsJsonContractsBinder ¶ added in v0.4.9
func (it *Wrapper) AsJsonContractsBinder() corejson.JsonContractsBinder
func (*Wrapper) CompiledError ¶ added in v0.5.4
func (*Wrapper) ConcatNew ¶ added in v0.4.7
ConcatNew It will create new errorwrapper.Wrapper and combined error with consts.DefaultErrorLineSeparator
func (*Wrapper) ConcatNewErrors ¶ added in v0.4.7
ConcatNewErrors It will create new errorwrapper.Wrapper and combined errors with consts.DefaultErrorLineSeparator
func (*Wrapper) ConcatNewMessage ¶ added in v0.4.7
ConcatNewMessage It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (*Wrapper) ConcatNewMessageWithRef1 ¶ added in v0.5.4
func (*Wrapper) ConcatNewMessageWithRef2 ¶ added in v0.5.4
func (*Wrapper) ConcatNewMessageWithRefs ¶ added in v0.5.4
func (*Wrapper) ConcatNewMessageWithRefsOnly ¶ added in v0.5.4
func (*Wrapper) ConcatNewMessages ¶ added in v0.4.9
ConcatNewMessages It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (*Wrapper) ConcatNewWrapperError ¶ added in v0.4.7
ConcatNewWrapperError Warning : It will not take anything other than error message to combine with.
func (*Wrapper) ErrorString ¶
ErrorString if empty error then returns ""
func (*Wrapper) FullOrErrorMessage ¶ added in v0.7.1
func (*Wrapper) FullString ¶
func (*Wrapper) FullStringPtr ¶
func (*Wrapper) FullStringSplitByNewLine ¶ added in v0.7.1
func (*Wrapper) GetTypeString ¶
GetTypeString
Format : errconsts.VariantStructStringFormat
"%s (Code - %d) : %s" : "TypeName (Code - ValueInt) : Message from type string"
func (*Wrapper) GetTypeVariantStruct ¶
func (it *Wrapper) GetTypeVariantStruct() errtype.VariantStructure
func (*Wrapper) GetTypeWithCodeString ¶
GetTypeWithCodeString
Format : errconsts.ErrorCodeWithTypeNameFormat
"(Code - #%d) : %s"
func (*Wrapper) GetTypeWithCodeStringPtr ¶
GetTypeWithCodeStringPtr
Format : errconsts.ErrorCodeWithTypeNameFormat
"(Code - #%d) : %s"
func (*Wrapper) HandleError ¶
func (it *Wrapper) HandleError()
HandleError Only call panic if has currentError
func (*Wrapper) HandleErrorWithMsg ¶
HandleErrorWithMsg Only call panic if has currentError
func (*Wrapper) HandleErrorWithRefs ¶
func (*Wrapper) IsEmptyError ¶ added in v0.4.9
func (*Wrapper) IsErrorEquals ¶
func (*Wrapper) IsErrorMessage ¶
IsErrorMessage If error IsEmpty then returns false regardless
func (*Wrapper) IsErrorMessageContains ¶
IsErrorMessageContains If error IsEmpty then returns false regardless
func (*Wrapper) IsErrorMessageEqual ¶
func (*Wrapper) IsReferencesEmpty ¶ added in v0.0.4
func (*Wrapper) JsonModel ¶ added in v0.4.0
func (it *Wrapper) JsonModel() *WrapperDataModel
func (*Wrapper) JsonModelAny ¶ added in v0.4.0
func (it *Wrapper) JsonModelAny() interface{}
func (*Wrapper) JsonParseSelfInject ¶ added in v0.4.0
func (*Wrapper) LogErrorOnExist ¶ added in v0.7.1
func (it *Wrapper) LogErrorOnExist()
func (*Wrapper) LogErrorOnly ¶ added in v0.7.1
func (it *Wrapper) LogErrorOnly()
func (*Wrapper) LogFatalOnExist ¶ added in v0.7.1
func (it *Wrapper) LogFatalOnExist()
func (*Wrapper) LogOnExist ¶ added in v0.7.1
func (it *Wrapper) LogOnExist()
func (*Wrapper) MarshalJSON ¶ added in v0.4.0
func (*Wrapper) ParseInjectUsingJson ¶ added in v0.4.0
func (*Wrapper) ParseInjectUsingJsonMust ¶ added in v0.4.0
ParseInjectUsingJsonMust Panic if error
func (*Wrapper) References ¶ added in v0.6.3
func (it *Wrapper) References() *refs.Collection
func (*Wrapper) SimpleErrorStringPtr ¶ added in v0.5.4
func (*Wrapper) TypeString ¶
func (*Wrapper) UnmarshalJSON ¶ added in v0.4.0
func (*Wrapper) ValidationErrUsingTextValidator ¶ added in v0.7.1
func (it *Wrapper) ValidationErrUsingTextValidator( validator *corevalidator.TextValidator, params *corevalidator.ValidatorParamsBase, ) *Wrapper
type WrapperDataModel ¶ added in v0.4.0
type WrapperDataModel struct { IsPrintErrorType bool CurrentError string References *refs.Collection ErrorType errtype.Variation HasError bool }
func NewDataModel ¶ added in v0.4.0
func NewDataModel(wrapper *Wrapper) *WrapperDataModel
Source Files
¶
- CombineErrorAndMessageToError.go
- CombineErrorsToSingle.go
- CombineErrorsToSingleString.go
- CombineErrorsToSingleWrapper.go
- ReferencesCompileString.go
- ReferencesCsvStrings.go
- SimpleReferencesCompile.go
- SimpleReferencesCompileOptimized.go
- Wrapper.go
- WrapperDataModel.go
- contructors.go
- transpile.go
- vars.go