Documentation
¶
Index ¶
- Constants
- Variables
- func ErrorMessageToError(err error, msg string) error
- func ErrorType(basicErrWrapper errcoreinf.BasicErrWrapper) errtype.Variation
- func ErrorsToError(errItems ...error) error
- func ErrorsToString(errItems ...error) string
- func ErrorsToStringUsingJoiner(joiner string, errItems ...error) string
- func MessagesJoined(messages ...string) string
- func SimpleReferencesCompile(errType errtype.Variation, references ...interface{}) string
- func SimpleReferencesCompileOptimized(errType errtype.Variation, references ...interface{}) string
- type BasicErrWrapper
- type Cloner
- type ConcatNew
- func (it ConcatNew) AsConcatenateNewer() ConcatenateNewer
- func (it ConcatNew) BasicError(basicErr errcoreinf.BasicErrWrapper) *Wrapper
- func (it ConcatNew) BasicErrorUsingStackSkip(stackSkip int, basicErr errcoreinf.BasicErrWrapper) *Wrapper
- func (it ConcatNew) CloneStackSkip(skipStackIndex int) *Wrapper
- func (it ConcatNew) Error(err error) *Wrapper
- func (it ConcatNew) ErrorInterface(errInf errcoreinf.BaseErrorOrCollectionWrapper) *Wrapper
- func (it ConcatNew) ErrorInterfaceUsingStackSkip(stackSkip int, errInf errcoreinf.BaseErrorOrCollectionWrapper) *Wrapper
- func (it ConcatNew) ErrorUsingStackSkip(skipStackIndex int, err error) *Wrapper
- func (it ConcatNew) Errors(errItems ...error) *Wrapper
- func (it ConcatNew) ErrorsUsingStackSkip(skipStackIndex int, errItems ...error) *Wrapper
- func (it ConcatNew) Message(appendingMessage string) *Wrapper
- func (it ConcatNew) Messages(errMessages ...string) *Wrapper
- func (it ConcatNew) MessagesUsingStackSkip(skipStackIndex int, errMessages ...string) *Wrapper
- func (it ConcatNew) Msg(errMsg string) *Wrapper
- func (it ConcatNew) MsgRefOne(skipStackIndex int, errMsg string, variableName string, valueAny interface{}) *Wrapper
- func (it ConcatNew) MsgRefTwo(skipStackIndex int, errMsg string, firstVariable string, ...) *Wrapper
- func (it ConcatNew) MsgRefs(skipStackIndex int, errMsg string, references ...ref.Value) *Wrapper
- func (it ConcatNew) MsgRefsOnly(references ...ref.Value) *Wrapper
- func (it ConcatNew) MsgUsingStackSkip(skipStackIndex int, errMsg string) *Wrapper
- func (it ConcatNew) NewStackSkip(stackSkip int) *Wrapper
- func (it ConcatNew) NewStackTraces(stackTraces ...codestack.Trace) *Wrapper
- func (it ConcatNew) Wrapper(another *Wrapper) *Wrapper
- func (it ConcatNew) WrapperUsingStackSkip(skipStackIndex int, right *Wrapper) *Wrapper
- type ConcatNewGetter
- type ConcatenateNewer
- type ErrWrapper
- type ErrWrapperContractsBinder
- type ErrorStringer
- type ErrorTypeStringer
- type Getter
- type InterfaceGetter
- type MustBeEmptyError
- type ReflectSetToErrorWrapper
- type ResultsContractsBinder
- type StringFmtFunc
- type TypeOfErrorWrapperGetter
- type ValueWithErrorWrapper
- type ValueWithErrorWrapperBinder
- type ValuesWithErrorWrapper
- type ValuesWithErrorWrapperCollectionBinder
- type Wrapper
- func CastBasicErrWrapperToWrapper(basicErrWrapper errcoreinf.BasicErrWrapper) *Wrapper
- func CastInterfaceToErrorWrapper(errorInterface errcoreinf.BaseErrorOrCollectionWrapper) *Wrapper
- func CastInterfaceToErrorWrapperUsingStackSkip(stackStartIndex int, errorInterface errcoreinf.BaseErrorOrCollectionWrapper) *Wrapper
- func Empty() Wrapper
- func EmptyPrint() Wrapper
- func EmptyPtr() *Wrapper
- func ErrorsToWrap(errType errtype.Variation, errItems ...error) *Wrapper
- func ErrorsToWrapper(errType errtype.Variation, errItems ...error) *Wrapper
- func InterfaceToErrorWrapper(errType errtype.Variation, ...) *Wrapper
- func InterfaceToErrorWrapperUsingStackSkip(stackStartIndex int, errType errtype.Variation, ...) *Wrapper
- func JsonResultToWrapper(jsonResult *corejson.Result) (*Wrapper, error)
- func New(errType errtype.Variation) Wrapper
- func NewErrUsingAllParams(stackSkipIndex int, errType errtype.Variation, isDisplayableError bool, ...) Wrapper
- func NewErrUsingAllParamsPtr(stackSkipIndex int, errType errtype.Variation, isDisplayableError bool, ...) *Wrapper
- func NewError(stackSkipIndex int, err error) *Wrapper
- func NewErrorPlusMsgUsingAllParamsPtr(stackSkipIndex int, errType errtype.Variation, isDisplayableError bool, ...) *Wrapper
- func NewErrorRef1(stackSkipIndex int, errType errtype.Variation, err error, var1 string, ...) *Wrapper
- func NewFromDataModel(model *WrapperDataModel) *Wrapper
- func NewGeneric(stackSkipIndex int, error error) *Wrapper
- func NewInterfacesToErrorWrappers(errorInterfaces ...errcoreinf.BaseErrorOrCollectionWrapper) []*Wrapper
- func NewMessagesUsingJoiner(stackSkipIndex int, errType errtype.Variation, joiner string, ...) *Wrapper
- func NewMsgDisplayError(stackSkipIndex int, errType errtype.Variation, message string, ...) *Wrapper
- func NewMsgDisplayErrorNoReference(stackSkipIndex int, errType errtype.Variation, message string) *Wrapper
- func NewMsgDisplayErrorReferencesPtr(stackSkipIndex int, errType errtype.Variation, message string, ...) *Wrapper
- func NewMsgDisplayErrorUsingStackTracesPtr(errType errtype.Variation, message string, ...) *Wrapper
- func NewMsgUsingAllParams(stackSkipIndex int, errType errtype.Variation, isDisplayableError bool, ...) *Wrapper
- func NewMsgUsingCodeStacksPtr(errType errtype.Variation, isDisplayableError bool, message string, ...) *Wrapper
- func NewOnlyRefs(stackSkipIndex int, errType errtype.Variation, refValues ...ref.Value) *Wrapper
- func NewPath(stackSkipIndex int, errType errtype.Variation, error error, filePath string) *Wrapper
- func NewPathMessages(stackSkipIndex int, errType errtype.Variation, filePath string, ...) *Wrapper
- func NewPathMsg(stackSkipIndex int, errType errtype.Variation, message, filePath string) *Wrapper
- func NewPtr(errType errtype.Variation) *Wrapper
- func NewPtrUsingStackSkip(stackStartIndex int, errType errtype.Variation) *Wrapper
- func NewRef(stackSkipIndex int, errType errtype.Variation, err error, varName string, ...) *Wrapper
- func NewRef1Msg(stackSkipIndex int, errType errtype.Variation, msg string, var1 string, ...) *Wrapper
- func NewRef2(stackSkipIndex int, errType errtype.Variation, error error, varName string, ...) *Wrapper
- func NewRef2Msg(stackSkipIndex int, errType errtype.Variation, msg string, var1 string, ...) *Wrapper
- func NewRefOne(stackSkipIndex int, errType errtype.Variation, var1 string, val1 interface{}) *Wrapper
- func NewRefWithMessage(stackSkipIndex int, errType errtype.Variation, message string, ...) *Wrapper
- func NewRefs(stackSkipIndex int, errType errtype.Variation, error error, ...) *Wrapper
- func NewTypeUsingStackSkip(stackSkipIndex int, errType errtype.Variation) *Wrapper
- func NewUnknownMessage(stackSkipIndex int, isDisplayableError bool, message string) *Wrapper
- func NewUsingBasicErr(basicErrWrapper errcoreinf.BasicErrWrapper) *Wrapper
- func NewUsingBasicErrStackSkip(stackStartIndex int, basicErrWrapper errcoreinf.BasicErrWrapper) *Wrapper
- func NewUsingError(stackSkipIndex int, errType errtype.Variation, err error) *Wrapper
- func NewUsingErrorAndMessage(stackSkipIndex int, err error, msg string) *Wrapper
- func NewUsingErrorWithoutTypeDisplay(errType errtype.Variation, err error) Wrapper
- func NewUsingErrorWithoutTypeDisplayPtr(errType errtype.Variation, err error) *Wrapper
- func NewUsingManyErrorInterfacesStackSkip(stackStartIndex int, errType errtype.Variation, ...) *Wrapper
- func NewUsingTypeErrorAndMessage(stackSkipIndex int, errType errtype.Variation, err error, msg string) *Wrapper
- func NewUsingWrapper(stackSkipIndex int, currentWrapper *Wrapper, additionalReferences ...ref.Value) *Wrapper
- func TypeReferenceQuick(stackSkipIndex int, errType errtype.Variation, referencesValues ...interface{}) *Wrapper
- func (it Wrapper) AsErrWrapperContractsBinder() ErrWrapperContractsBinder
- func (it *Wrapper) AsErrorWrapper() *Wrapper
- func (it *Wrapper) AsJsonContractsBinder() corejson.JsonContractsBinder
- func (it Wrapper) Clone() Wrapper
- func (it *Wrapper) CloneInterface() errcoreinf.BasicErrWrapper
- func (it Wrapper) CloneNewStackSkipPtr(stackSkip int) *Wrapper
- func (it *Wrapper) ClonePtr() *Wrapper
- func (it *Wrapper) CloneReferences() *refs.Collection
- func (it *Wrapper) CodeTypeName() string
- func (it *Wrapper) Compile() string
- func (it *Wrapper) CompileString() string
- func (it *Wrapper) CompiledError() error
- func (it *Wrapper) CompiledErrorWithStackTraces() error
- func (it *Wrapper) CompiledJsonErrorWithStackTraces() error
- func (it *Wrapper) CompiledJsonStringWithStackTraces() (jsonString string)
- func (it *Wrapper) CompiledStackTracesString() string
- func (it *Wrapper) ConcatNew() ConcatNew
- func (it *Wrapper) Dispose()
- func (it *Wrapper) Error() error
- func (it *Wrapper) ErrorString() string
- func (it *Wrapper) ErrorTypeAsBasicErrorTyper() errcoreinf.BasicErrorTyper
- func (it *Wrapper) FullOrErrorMessage(isErrorMessage, isWithRef bool) string
- func (it *Wrapper) FullString() string
- func (it *Wrapper) FullStringSplitByNewLine() []string
- func (it *Wrapper) FullStringWithLimitTraces(limit int) string
- func (it *Wrapper) FullStringWithTraces() string
- func (it *Wrapper) FullStringWithTracesIf(isStackTraces bool) string
- func (it *Wrapper) FullStringWithoutReferences() string
- func (it *Wrapper) GetAsBasicWrapper() errcoreinf.BasicErrWrapper
- func (it *Wrapper) GetAsBasicWrapperUsingTyper(errorTyper errcoreinf.BasicErrorTyper) errcoreinf.BasicErrWrapper
- func (it *Wrapper) GetTypeVariantStruct() errtype.VariantStructure
- func (it *Wrapper) HandleError()
- func (it *Wrapper) HandleErrorWithMsg(newMessage string)
- func (it *Wrapper) HandleErrorWithRefs(newMessage string, refVar, refVal interface{})
- func (it *Wrapper) HasAnyError() bool
- func (it *Wrapper) HasAnyIssues() bool
- func (it *Wrapper) HasCurrentError() bool
- func (it *Wrapper) HasError() bool
- func (it *Wrapper) HasReferences() bool
- func (it *Wrapper) IsAnyNull() bool
- func (it *Wrapper) IsBasicErrEqual(another errcoreinf.BasicErrWrapper) bool
- func (it *Wrapper) IsCollect(another errcoreinf.BaseErrorOrCollectionWrapper) bool
- func (it *Wrapper) IsCollectOn(isCollect bool, another errcoreinf.BaseErrorOrCollectionWrapper) bool
- func (it *Wrapper) IsCollectedAny(anotherItems ...errcoreinf.BaseErrorOrCollectionWrapper) bool
- func (it *Wrapper) IsCollectionType() bool
- func (it *Wrapper) IsDefined() bool
- func (it *Wrapper) IsEmpty() bool
- func (it *Wrapper) IsEmptyAll(anotherItems ...errcoreinf.BaseErrorOrCollectionWrapper) bool
- func (it *Wrapper) IsEmptyError() bool
- func (it *Wrapper) IsEquals(right *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) IsInvalid() bool
- func (it *Wrapper) IsNoError() bool
- func (it *Wrapper) IsNotEquals(right *Wrapper) bool
- func (it *Wrapper) IsNull() 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) JsonPtr() *corejson.Result
- func (it Wrapper) JsonResultWithoutTraces() *corejson.Result
- func (it *Wrapper) Log()
- func (it *Wrapper) LogFatal()
- func (it *Wrapper) LogFatalWithTraces()
- func (it *Wrapper) LogIf(isLog bool)
- func (it *Wrapper) LogWithTraces()
- func (it Wrapper) MarshalJSON() ([]byte, error)
- func (it *Wrapper) MergeNewErrInf(right errcoreinf.BaseErrorOrCollectionWrapper) errcoreinf.BaseErrorOrCollectionWrapper
- func (it *Wrapper) MergeNewMessage(newMessage string) errcoreinf.BaseErrorOrCollectionWrapper
- func (it *Wrapper) MergeNewReferences(additionalReferences ...ref.Value) *refs.Collection
- func (it *Wrapper) MustBeEmpty()
- func (it *Wrapper) MustBeEmptyError()
- func (it *Wrapper) MustBeSafe()
- func (it *Wrapper) NewDefaultStackTraces() string
- func (it *Wrapper) NewDefaultStackTracesJsonResult() *corejson.Result
- func (it *Wrapper) NewStackTraces(stackSkip int) string
- func (it *Wrapper) NewStackTracesJsonResult(stackSkip int) *corejson.Result
- func (it Wrapper) NonPtr() Wrapper
- func (it *Wrapper) ParseInjectUsingJson(jsonResult *corejson.Result) (*Wrapper, error)
- func (it *Wrapper) ParseInjectUsingJsonMust(jsonResult *corejson.Result) *Wrapper
- func (it Wrapper) Ptr() *Wrapper
- func (it *Wrapper) RawErrorTypeName() string
- func (it *Wrapper) RawErrorTypeValue() uint16
- func (it *Wrapper) References() *refs.Collection
- func (it Wrapper) ReferencesCollection() errcoreinf.ReferenceCollectionDefiner
- func (it *Wrapper) ReferencesCompiledString() string
- func (it *Wrapper) ReferencesList() []errcoreinf.Referencer
- func (it *Wrapper) ReflectSetTo(toPtr interface{}) error
- func (it *Wrapper) ReflectSetToErrWrap(toPtr interface{}) *Wrapper
- func (it *Wrapper) Serialize() ([]byte, error)
- func (it *Wrapper) SerializeMust() []byte
- func (it *Wrapper) SerializeWithoutTraces() ([]byte, error)
- func (it *Wrapper) StackTraceString() string
- func (it *Wrapper) StackTraces() string
- func (it *Wrapper) StackTracesJsonResult() *corejson.Result
- func (it *Wrapper) StackTracesLimit(limit int) *codestack.TraceCollection
- func (it Wrapper) String() string
- func (it Wrapper) StringIf(isWithRef bool) string
- func (it *Wrapper) Type() errtype.Variation
- func (it *Wrapper) TypeCodeNameString() string
- func (it *Wrapper) TypeName() string
- func (it *Wrapper) TypeNameCode() string
- func (it *Wrapper) TypeNameCodeMessage() string
- func (it *Wrapper) TypeNameWithCustomMessage(customMessage string) string
- 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 ¶
const (
MessagesJoiner = constants.Space
)
Variables ¶
var ( StaticEmpty = Empty() StaticEmptyPtr = &StaticEmpty )
Functions ¶
func ErrorMessageToError ¶ added in v0.8.0
ErrorMessageToError final error is nil if err is nil
func ErrorType ¶ added in v0.9.6
func ErrorType( basicErrWrapper errcoreinf.BasicErrWrapper, ) errtype.Variation
func ErrorsToStringUsingJoiner ¶ added in v0.8.0
ErrorsToStringUsingJoiner nil items will be ignored.
func MessagesJoined ¶ added in v0.7.8
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 BasicErrWrapper ¶ added in v0.9.6
type BasicErrWrapper interface { errcoreinf.BasicErrWrapper StackTraceString() string AsErrorWrapper() *Wrapper IsNoError() bool coreinterface.Stringer }
type ConcatNew ¶ added in v0.8.9
type ConcatNew struct {
// contains filtered or unexported fields
}
func (ConcatNew) AsConcatenateNewer ¶ added in v0.8.9
func (it ConcatNew) AsConcatenateNewer() ConcatenateNewer
func (ConcatNew) BasicError ¶ added in v0.9.6
func (it ConcatNew) BasicError( basicErr errcoreinf.BasicErrWrapper, ) *Wrapper
func (ConcatNew) BasicErrorUsingStackSkip ¶ added in v0.9.6
func (it ConcatNew) BasicErrorUsingStackSkip( stackSkip int, basicErr errcoreinf.BasicErrWrapper, ) *Wrapper
func (ConcatNew) CloneStackSkip ¶ added in v0.8.9
func (ConcatNew) Error ¶ added in v0.8.9
Error
It will create new errorwrapper.Wrapper and combined error with consts.DefaultErrorLineSeparator
func (ConcatNew) ErrorInterface ¶ added in v0.9.6
func (it ConcatNew) ErrorInterface( errInf errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
func (ConcatNew) ErrorInterfaceUsingStackSkip ¶ added in v0.9.6
func (it ConcatNew) ErrorInterfaceUsingStackSkip( stackSkip int, errInf errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
func (ConcatNew) ErrorUsingStackSkip ¶ added in v0.8.9
ErrorUsingStackSkip
It will create new errorwrapper.Wrapper and combined error with consts.DefaultErrorLineSeparator
func (ConcatNew) Errors ¶ added in v0.8.9
Errors
It will create new errorwrapper.Wrapper and combined errors with consts.DefaultErrorLineSeparator
func (ConcatNew) ErrorsUsingStackSkip ¶ added in v0.8.9
ErrorsUsingStackSkip
It will create new errorwrapper.Wrapper and combined errors with consts.DefaultErrorLineSeparator
func (ConcatNew) Message ¶ added in v0.9.6
Message
It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (ConcatNew) Messages ¶ added in v0.8.9
Messages
It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (ConcatNew) MessagesUsingStackSkip ¶ added in v0.8.9
MessagesUsingStackSkip
It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (ConcatNew) Msg ¶ added in v0.8.9
Msg
It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (ConcatNew) MsgRefsOnly ¶ added in v0.8.9
func (ConcatNew) MsgUsingStackSkip ¶ added in v0.8.9
MsgUsingStackSkip
It will create new errorwrapper.Wrapper and combined msg with consts.DefaultErrorLineSeparator
func (ConcatNew) NewStackSkip ¶ added in v0.9.6
func (ConcatNew) NewStackTraces ¶ added in v0.8.9
type ConcatNewGetter ¶ added in v0.9.6
type ConcatNewGetter interface {
ConcatNew() ConcatNew
}
type ConcatenateNewer ¶ added in v0.8.9
type ConcatenateNewer interface { NewStackSkip(stackSkip int) *Wrapper Error(err error) *Wrapper ErrorUsingStackSkip(skipStackIndex int, err error) *Wrapper Msg(errMsg string) *Wrapper MsgUsingStackSkip(skipStackIndex int, errMsg string) *Wrapper MessagesUsingStackSkip(skipStackIndex int, errMessages ...string) *Wrapper MsgRefs( skipStackIndex int, errMsg string, references ...ref.Value, ) *Wrapper MsgRefsOnly( references ...ref.Value, ) *Wrapper Errors( errItems ...error, ) *Wrapper ErrorsUsingStackSkip(skipStackIndex int, errItems ...error) *Wrapper Wrapper(another *Wrapper) *Wrapper WrapperUsingStackSkip(skipStackIndex int, another *Wrapper) *Wrapper ErrorInterface(errInf errcoreinf.BaseErrorOrCollectionWrapper) *Wrapper ErrorInterfaceUsingStackSkip( stackSkip int, errInf errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper BasicError( basicErr errcoreinf.BasicErrWrapper, ) *Wrapper BasicErrorUsingStackSkip( stackSkip int, basicErr errcoreinf.BasicErrWrapper, ) *Wrapper NewStackTraces( stackTraces ...codestack.Trace, ) *Wrapper CloneStackSkip( skipStackIndex int, ) *Wrapper }
type ErrWrapper ¶ added in v0.9.6
type ErrWrapper interface { BasicErrWrapper TypeOfErrorWrapperGetter // MustBeEmptyError // // Panics if error exist MustBeEmptyError References() *refs.Collection MergeNewReferences(additionalReferences ...ref.Value) *refs.Collection IsTypeOf(errType errtype.Variation) bool ReflectSetToErrorWrapper corejson.JsonContractsBinder }
type ErrWrapperContractsBinder ¶ added in v0.9.6
type ErrWrapperContractsBinder interface { ErrWrapper AsErrWrapperContractsBinder() ErrWrapperContractsBinder }
type ErrorStringer ¶ added in v0.9.6
type ErrorStringer interface {
ErrorString() string
}
type ErrorTypeStringer ¶ added in v0.9.6
type InterfaceGetter ¶ added in v0.9.6
type InterfaceGetter interface {
ErrorWrapperInf() ErrWrapper
}
type MustBeEmptyError ¶ added in v0.9.6
type MustBeEmptyError interface {
MustBeEmpty()
}
type ReflectSetToErrorWrapper ¶ added in v0.9.6
type ReflectSetToErrorWrapper interface { // ReflectSetToErrWrap // // Set any object from to toPointer object // // Valid Inputs or Supported (https://t.ly/1Lpt): // - From, To: (null, null) -- do nothing // - From, To: (sameTypePointer, sameTypePointer) -- try reflection // - From, To: (sameTypeNonPointer, sameTypePointer) -- try reflection // - From, To: ([]byte or *[]byte, otherType) -- try unmarshal, reflect // - From, To: (otherType, *[]byte) -- try marshal, reflect // // Validations: // - Check null, if both null no error return quickly. // - NotSupported returns as error. // - NotSupported: (from, to) - (..., not pointer) // - NotSupported: (from, to) - (null, notNull) // - NotSupported: (from, to) - (notNull, null) // - NotSupported: (from, to) - not same type and not bytes on any // - `From` null or nil is not supported and will return error. // // Reference: // - Reflection String Set Example : https://go.dev/play/p/fySLYuOvoRK.go?download=true // - Method document screenshot : https://prnt.sc/26dmf5g ReflectSetToErrWrap(toPtr interface{}) *Wrapper }
ReflectSetToErrorWrapper
Set any object from to toPointer object ¶
Valid Inputs or Supported (https://t.ly/1Lpt):
- From, To: (null, null) -- do nothing
- From, To: (sameTypePointer, sameTypePointer) -- try reflection
- From, To: (sameTypeNonPointer, sameTypePointer) -- try reflection
- From, To: ([]byte or *[]byte, otherType) -- try unmarshal, reflect
- From, To: (otherType, *[]byte) -- try marshal, reflect
Validations:
- Check null, if both null no error return quickly.
- NotSupported returns as error.
- NotSupported: (from, to) - (..., not pointer)
- NotSupported: (from, to) - (null, notNull)
- NotSupported: (from, to) - (notNull, null)
- NotSupported: (from, to) - not same type and not bytes on any
- `From` null or nil is not supported and will return error.
Reference:
- Reflection String Set Example : https://go.dev/play/p/fySLYuOvoRK.go?download=true
- Method document screenshot : https://prnt.sc/26dmf5g
type ResultsContractsBinder ¶ added in v0.9.6
type ResultsContractsBinder interface { ValuesWithErrorWrapper AsResultsContractsBinder() ResultsContractsBinder }
type StringFmtFunc ¶ added in v0.7.9
type TypeOfErrorWrapperGetter ¶ added in v0.9.6
type ValueWithErrorWrapper ¶ added in v0.9.6
type ValueWithErrorWrapper interface { coreinterface.HasErrorChecker coreinterface.IsEmptyChecker coreinterface.IsSuccessValidator coreinterface.IsInvalidChecker coreinterface.HasIssuesOrEmptyChecker coreinterface.Stringer corejson.Jsoner corejson.JsonParseSelfInjector corejson.JsonContractsBinder coreinterface.HasSafeItemsChecker InterfaceGetter coreinterface.SafeStringer coreinterface.Disposer }
type ValueWithErrorWrapperBinder ¶ added in v0.9.6
type ValueWithErrorWrapperBinder interface { ValueWithErrorWrapper AsValueWithErrorWrapperBinder() ValueWithErrorWrapperBinder }
type ValuesWithErrorWrapper ¶ added in v0.9.6
type ValuesWithErrorWrapper interface { ValueWithErrorWrapper coreinterface.Clearer coreinterface.HasAnyItemChecker coreinterface.LengthGetter coreinterface.IsAnyNullChecker }
type ValuesWithErrorWrapperCollectionBinder ¶ added in v0.9.6
type ValuesWithErrorWrapperCollectionBinder interface { ValuesWithErrorWrapper AsValuesWithErrorWrapperCollectionBinder() ValuesWithErrorWrapperCollectionBinder }
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
func CastBasicErrWrapperToWrapper ¶ added in v0.9.6
func CastBasicErrWrapperToWrapper( basicErrWrapper errcoreinf.BasicErrWrapper, ) *Wrapper
func CastInterfaceToErrorWrapper ¶ added in v0.9.6
func CastInterfaceToErrorWrapper( errorInterface errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
CastInterfaceToErrorWrapper
- if empty then returns nil or empty then
- cast to Wrapper on success returns
- On fail, usages BaseErrorOrCollectionWrapper.GetAsBasicWrapper() then cast
- cast to Wrapper on success return if failed
func CastInterfaceToErrorWrapperUsingStackSkip ¶ added in v0.9.6
func CastInterfaceToErrorWrapperUsingStackSkip( stackStartIndex int, errorInterface errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
func EmptyPrint ¶ added in v0.0.4
func EmptyPrint() Wrapper
func ErrorsToWrapper ¶ added in v0.8.0
ErrorsToWrapper nil items will be ignored.
func InterfaceToErrorWrapper ¶ added in v0.9.6
func InterfaceToErrorWrapper( errType errtype.Variation, errorInterface errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
InterfaceToErrorWrapper
first tries to cast to Wrapper if not successful then create new one.
func InterfaceToErrorWrapperUsingStackSkip ¶ added in v0.9.6
func InterfaceToErrorWrapperUsingStackSkip( stackStartIndex int, errType errtype.Variation, errorInterface errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
func JsonResultToWrapper ¶ added in v0.9.6
func NewErrUsingAllParams ¶
func NewErrUsingAllParamsPtr ¶
func NewErrorPlusMsgUsingAllParamsPtr ¶ added in v0.0.2
func NewErrorRef1 ¶ added in v0.6.5
func NewErrorRef1( stackSkipIndex int, errType errtype.Variation, err error, var1 string, val1 interface{}, ) *Wrapper
NewErrorRef1 alias for NewRef
func NewFromDataModel ¶ added in v0.4.0
func NewFromDataModel( model *WrapperDataModel, ) *Wrapper
func NewGeneric ¶
func NewInterfacesToErrorWrappers ¶ added in v0.9.6
func NewInterfacesToErrorWrappers( errorInterfaces ...errcoreinf.BaseErrorOrCollectionWrapper, ) []*Wrapper
func NewMessagesUsingJoiner ¶ added in v0.9.0
func NewMsgDisplayError ¶ added in v0.9.0
func NewMsgDisplayErrorNoReference ¶ added in v0.9.0
func NewMsgDisplayErrorReferencesPtr ¶ added in v0.8.3
func NewMsgDisplayErrorUsingStackTracesPtr ¶ added in v0.7.9
func NewMsgUsingAllParams ¶
func NewMsgUsingCodeStacksPtr ¶ added in v0.7.9
func NewMsgUsingCodeStacksPtr( errType errtype.Variation, isDisplayableError bool, message string, codeStacks codestack.TraceCollection, references *refs.Collection, ) *Wrapper
func NewOnlyRefs ¶ added in v0.5.2
func NewPathMessages ¶ added in v0.9.2
func NewPathMsg ¶ added in v0.9.2
func NewPtrUsingStackSkip ¶ added in v0.7.9
func NewRef1Msg ¶ added in v0.7.0
func NewRef2Msg ¶ added in v0.7.0
func NewRefWithMessage ¶ added in v0.5.2
func NewTypeUsingStackSkip ¶ added in v0.9.2
func NewUnknownMessage ¶ added in v0.9.0
func NewUsingBasicErr ¶ added in v0.9.6
func NewUsingBasicErr( basicErrWrapper errcoreinf.BasicErrWrapper, ) *Wrapper
func NewUsingBasicErrStackSkip ¶ added in v0.9.6
func NewUsingBasicErrStackSkip( stackStartIndex int, basicErrWrapper errcoreinf.BasicErrWrapper, ) *Wrapper
func NewUsingError ¶
func NewUsingErrorAndMessage ¶ added in v0.4.7
func NewUsingErrorWithoutTypeDisplayPtr ¶ added in v0.3.9
func NewUsingManyErrorInterfacesStackSkip ¶ added in v0.9.6
func NewUsingManyErrorInterfacesStackSkip( stackStartIndex int, errType errtype.Variation, errorInterfaces ...errcoreinf.BaseErrorOrCollectionWrapper, ) *Wrapper
func NewUsingTypeErrorAndMessage ¶ added in v0.4.7
func NewUsingWrapper ¶ added in v0.5.4
func TypeReferenceQuick ¶ added in v0.7.0
func TypeReferenceQuick( stackSkipIndex int, errType errtype.Variation, referencesValues ...interface{}, ) *Wrapper
TypeReferenceQuick - errorTypeName - (...., items)...
func (Wrapper) AsErrWrapperContractsBinder ¶ added in v0.9.6
func (it Wrapper) AsErrWrapperContractsBinder() ErrWrapperContractsBinder
func (*Wrapper) AsErrorWrapper ¶ added in v0.7.3
func (*Wrapper) AsJsonContractsBinder ¶ added in v0.4.9
func (it *Wrapper) AsJsonContractsBinder() corejson.JsonContractsBinder
func (*Wrapper) CloneInterface ¶ added in v0.9.6
func (it *Wrapper) CloneInterface() errcoreinf.BasicErrWrapper
func (Wrapper) CloneNewStackSkipPtr ¶ added in v0.8.9
func (*Wrapper) CloneReferences ¶ added in v0.9.6
func (it *Wrapper) CloneReferences() *refs.Collection
func (*Wrapper) CodeTypeName ¶ added in v0.9.6
func (*Wrapper) CompiledError ¶ added in v0.5.4
func (*Wrapper) CompiledErrorWithStackTraces ¶ added in v0.7.9
func (*Wrapper) CompiledJsonErrorWithStackTraces ¶ added in v0.9.6
func (*Wrapper) CompiledJsonStringWithStackTraces ¶ added in v0.9.6
func (*Wrapper) CompiledStackTracesString ¶ added in v0.9.6
func (*Wrapper) ErrorString ¶
ErrorString if empty error then returns ""
func (*Wrapper) ErrorTypeAsBasicErrorTyper ¶ added in v0.9.6
func (it *Wrapper) ErrorTypeAsBasicErrorTyper() errcoreinf.BasicErrorTyper
func (*Wrapper) FullOrErrorMessage ¶ added in v0.7.1
func (*Wrapper) FullString ¶
func (*Wrapper) FullStringSplitByNewLine ¶ added in v0.7.1
func (*Wrapper) FullStringWithLimitTraces ¶ added in v0.7.9
func (*Wrapper) FullStringWithTraces ¶ added in v0.7.9
func (*Wrapper) FullStringWithTracesIf ¶ added in v0.9.6
func (*Wrapper) FullStringWithoutReferences ¶ added in v0.9.2
func (*Wrapper) GetAsBasicWrapper ¶ added in v0.9.6
func (it *Wrapper) GetAsBasicWrapper() errcoreinf.BasicErrWrapper
func (*Wrapper) GetAsBasicWrapperUsingTyper ¶ added in v0.9.6
func (it *Wrapper) GetAsBasicWrapperUsingTyper( errorTyper errcoreinf.BasicErrorTyper, ) errcoreinf.BasicErrWrapper
func (*Wrapper) GetTypeVariantStruct ¶
func (it *Wrapper) GetTypeVariantStruct() errtype.VariantStructure
func (*Wrapper) HandleError ¶
func (it *Wrapper) HandleError()
HandleError
Only call panic if Wrapper has currentError
func (*Wrapper) HandleErrorWithMsg ¶
HandleErrorWithMsg Only call panic if has currentError
func (*Wrapper) HandleErrorWithRefs ¶
func (*Wrapper) HasAnyError ¶ added in v0.9.6
func (*Wrapper) HasAnyIssues ¶ added in v0.9.6
func (*Wrapper) HasCurrentError ¶ added in v0.8.9
HasCurrentError
Refers to Wrapper error embedded or not.
Best to use HasError
func (*Wrapper) HasError ¶
HasError
Returns true if not empty. Invert of IsEmpty()
Conditions (true):
- if Wrapper is NOT nil, Or,
- if Wrapper is NOT StaticEmptyPtr, Or,
- if Wrapper .errorType is NOT IsNoError(), Or,
- if Wrapper .currentError is nil and Wrapper .references.IsEmpty()
func (*Wrapper) HasReferences ¶ added in v0.9.6
func (*Wrapper) IsBasicErrEqual ¶ added in v0.9.6
func (it *Wrapper) IsBasicErrEqual( another errcoreinf.BasicErrWrapper, ) bool
func (*Wrapper) IsCollect ¶ added in v0.9.6
func (it *Wrapper) IsCollect( another errcoreinf.BaseErrorOrCollectionWrapper, ) bool
IsCollect
ConcatNew() recommend to use instead.
Warning :
mutates current error, recommended NOT use, it is for the commonalities between error Wrapper and collection
func (*Wrapper) IsCollectOn ¶ added in v0.9.6
func (it *Wrapper) IsCollectOn( isCollect bool, another errcoreinf.BaseErrorOrCollectionWrapper, ) bool
IsCollectOn
ConcatNew() recommend to use instead.
Warning :
mutates current error, recommended NOT use, it is for the commonalities between error Wrapper and collection
func (*Wrapper) IsCollectedAny ¶ added in v0.9.6
func (it *Wrapper) IsCollectedAny( anotherItems ...errcoreinf.BaseErrorOrCollectionWrapper, ) bool
IsCollectedAny
ConcatNew() recommend to use instead.
Warning :
mutates current error, recommended NOT use, it is for the commonalities between error Wrapper and collection
func (*Wrapper) IsCollectionType ¶ added in v0.9.6
func (*Wrapper) IsEmpty ¶
IsEmpty
Refers to no error for print or doesn't treat this as error.
Conditions (true):
- if Wrapper nil, Or,
- if Wrapper is StaticEmptyPtr, Or,
- if Wrapper .errorType is IsNoError(), Or,
- if Wrapper .currentError NOT nil and Wrapper .references.IsEmpty()
func (*Wrapper) IsEmptyAll ¶ added in v0.9.6
func (it *Wrapper) IsEmptyAll( anotherItems ...errcoreinf.BaseErrorOrCollectionWrapper, ) bool
func (*Wrapper) IsEmptyError ¶ added in v0.4.9
func (*Wrapper) IsErrorEquals ¶
func (*Wrapper) IsErrorMessageContains ¶
IsErrorMessageContains If error IsEmpty then returns false regardless
func (*Wrapper) IsErrorMessageEqual ¶
func (*Wrapper) IsNotEquals ¶ added in v0.8.9
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) JsonResultWithoutTraces ¶ added in v0.9.8
func (*Wrapper) LogFatalWithTraces ¶ added in v0.8.0
func (it *Wrapper) LogFatalWithTraces()
func (*Wrapper) LogWithTraces ¶ added in v0.8.0
func (it *Wrapper) LogWithTraces()
func (Wrapper) MarshalJSON ¶ added in v0.4.0
func (*Wrapper) MergeNewErrInf ¶ added in v0.9.6
func (it *Wrapper) MergeNewErrInf(right errcoreinf.BaseErrorOrCollectionWrapper) errcoreinf.BaseErrorOrCollectionWrapper
func (*Wrapper) MergeNewMessage ¶ added in v0.9.6
func (it *Wrapper) MergeNewMessage(newMessage string) errcoreinf.BaseErrorOrCollectionWrapper
func (*Wrapper) MergeNewReferences ¶ added in v0.9.4
func (it *Wrapper) MergeNewReferences(additionalReferences ...ref.Value) *refs.Collection
func (*Wrapper) MustBeEmpty ¶ added in v0.9.6
func (it *Wrapper) MustBeEmpty()
func (*Wrapper) MustBeEmptyError ¶ added in v0.9.6
func (it *Wrapper) MustBeEmptyError()
func (*Wrapper) MustBeSafe ¶ added in v0.9.6
func (it *Wrapper) MustBeSafe()
func (*Wrapper) NewDefaultStackTraces ¶ added in v0.9.6
func (*Wrapper) NewDefaultStackTracesJsonResult ¶ added in v0.9.6
func (*Wrapper) NewStackTraces ¶ added in v0.9.6
func (*Wrapper) NewStackTracesJsonResult ¶ added in v0.9.6
func (*Wrapper) ParseInjectUsingJson ¶ added in v0.4.0
func (*Wrapper) ParseInjectUsingJsonMust ¶ added in v0.4.0
ParseInjectUsingJsonMust Panic if error
func (*Wrapper) RawErrorTypeName ¶ added in v0.8.3
func (*Wrapper) RawErrorTypeValue ¶ added in v0.9.6
func (*Wrapper) References ¶ added in v0.6.3
func (it *Wrapper) References() *refs.Collection
func (Wrapper) ReferencesCollection ¶ added in v0.9.6
func (it Wrapper) ReferencesCollection() errcoreinf.ReferenceCollectionDefiner
func (*Wrapper) ReferencesCompiledString ¶ added in v0.9.6
func (*Wrapper) ReferencesList ¶ added in v0.9.6
func (it *Wrapper) ReferencesList() []errcoreinf.Referencer
func (*Wrapper) ReflectSetTo ¶ added in v0.9.6
ReflectSetTo
Set any object from to toPointer object ¶
Valid Inputs or Supported (https://t.ly/1Lpt):
- From, To: (null, null) -- do nothing
- From, To: (sameTypePointer, sameTypePointer) -- try reflection
- From, To: (sameTypeNonPointer, sameTypePointer) -- try reflection
- From, To: ([]byte or *[]byte, otherType) -- try unmarshal, reflect
- From, To: (otherType, *[]byte) -- try marshal, reflect
Validations:
- Check null, if both null no error return quickly.
- NotSupported returns as error.
- NotSupported: (from, to) - (..., not pointer)
- NotSupported: (from, to) - (null, notNull)
- NotSupported: (from, to) - (notNull, null)
- NotSupported: (from, to) - not same type and not bytes on any
- `From` null or nil is not supported and will return error.
Reference:
- Reflection String Set Example : https://go.dev/play/p/fySLYuOvoRK.go?download=true
- Method document screenshot : https://prnt.sc/26dmf5g
func (*Wrapper) SerializeMust ¶ added in v0.9.6
func (*Wrapper) SerializeWithoutTraces ¶ added in v0.9.6
func (*Wrapper) StackTraceString ¶ added in v0.7.9
func (*Wrapper) StackTraces ¶ added in v0.9.6
func (*Wrapper) StackTracesJsonResult ¶ added in v0.9.6
func (*Wrapper) StackTracesLimit ¶ added in v0.7.9
func (it *Wrapper) StackTracesLimit(limit int) *codestack.TraceCollection
func (*Wrapper) TypeCodeNameString ¶ added in v0.8.3
TypeCodeNameString
Format : errconsts.ErrorCodeWithTypeNameFormat
"(Code - #%d) : %s"
func (*Wrapper) TypeName ¶ added in v0.8.3
TypeName
Returns error type name, on empty returns empty string.
Example :
- For errtype.NoError : ""
- For errtype.Generic : "Generic"
func (*Wrapper) TypeNameCode ¶ added in v0.8.3
TypeNameCode
Returns error type Code number value with name, on empty returns empty string.
Format :
- "(#%d - %s)"
- "(#1 - Generic)"
func (*Wrapper) TypeNameCodeMessage ¶ added in v0.9.6
func (*Wrapper) TypeNameWithCustomMessage ¶ added in v0.8.3
TypeNameWithCustomMessage
errconsts.ErrorCodeHyphenTypeNameWithLineFormat = "(#%d - %s) %s"
func (*Wrapper) TypeString ¶
TypeString
Returns whole type string, should be refactored to whole-type string name Format : - errconsts.VariantStructStringFormat - "%s (Code - %d) : %s" : "Name (Code - ValueInt) : Message from type string" - Exact Example for errtype.Generic : "Generic (Code - 1) : Generic error"
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 { IsDisplayableError bool CurrentError string ErrorType errtype.Variation StackTraces codestack.TraceCollection References *refs.Collection HasError bool }
func NewDataModel ¶ added in v0.4.0
func NewDataModel(wrapper *Wrapper) WrapperDataModel
Source Files
¶
- ConcatNew.go
- ConcatenateNewer.go
- ErrorMessageToError.go
- ErrorsToStringUsingJoiner.go
- ErrorsToWrapper.go
- JsonResultToWrapper.go
- NewFromDataModel.go
- SimpleReferencesCompile.go
- SimpleReferencesCompileOptimized.go
- Wrapper.go
- WrapperDataModel.go
- addReferences.go
- all-errors-converters.go
- all-interfaces.go
- consts.go
- contructors.go
- funcs.go
- messagesJoined.go
- transpile.go
- vars.go