errcore

package
v1.3.55 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: MIT Imports: 12 Imported by: 105

Documentation

Index

Constants

View Source
const (
	ReferenceStart  = "Reference(s) ("
	ReferenceEnd    = ")"
	ReferenceFormat = " Ref(s) { \"%v\" }"

	CannotConvertStringToByteForLessThanZero = "Cannot convert string to byte. String cannot be less than 0 for byte."
	CannotConvertStringToByteForMoreThan255  = "Cannot convert string to byte. String is a number " +
		"but larger than byte size. At max it could be 255."
	CannotConvertStringToByte = "Cannot convert string to byte."

	PrefixStackTrace        = constants.Hyphen + constants.Space
	PrefixStackTraceNewLine = constants.DefaultLine + PrefixStackTrace
	NewLineCodeStacksHeader = "\nCode Stacks :\n"
	CodeStacksHeaderNewLine = "Code Stacks :\n"
	ShouldBeMessageFormat   = "\"%v\" {actual} should be \"%v\" {expecting}" // actual, expecting
)

Variables

View Source
var (
	ShouldBe = shouldBe{}
	Expected = expected{}
)

Functions

func Combine

func Combine(
	genericMsg,
	otherMsg,
	reference string,
) string

func CombineWithMsgType

func CombineWithMsgType(
	genericMsg RawErrorType,
	otherMsg string,
	reference interface{},
) string

func CompiledError added in v0.9.8

func CompiledError(mainErr error, additionalMessage string) error

func CompiledErrorString added in v0.9.8

func CompiledErrorString(mainErr error, additionalMessage string) string

func ConcatMessageWithErr added in v1.2.16

func ConcatMessageWithErr(
	errMessage string,
	err error,
) error

func EnumRangeNotMeet

func EnumRangeNotMeet(
	rangeStart interface{},
	rangeEnd interface{},
	wholeRange interface{},
) string

func ErrPrint

func ErrPrint(
	err error,
)

func ErrPrintWithTestIndex

func ErrPrintWithTestIndex(
	caseIndex int,
	err error,
)

func ErrorToSplitLines

func ErrorToSplitLines(err error) []string

func ErrorToSplitNonEmptyLines

func ErrorToSplitNonEmptyLines(err error) []string

func ErrorWithCompiledTraceRef

func ErrorWithCompiledTraceRef(
	err error,
	compiledTraces string,
	reference interface{},
) string

func ErrorWithCompiledTraceRefToError

func ErrorWithCompiledTraceRefToError(
	err error,
	compiledTraces string,
	reference interface{},
) error

func ErrorWithRef

func ErrorWithRef(err error, reference interface{}) string

func ErrorWithRefToError

func ErrorWithRefToError(err error, reference interface{}) error

func ErrorWithTracesRefToError

func ErrorWithTracesRefToError(
	err error,
	traces []string,
	reference interface{},
) error

func Expecting

func Expecting(title, wasExpecting, actual interface{}) string

Expecting

returns

"%s - expecting (type:[%T]) : [\"%v\"], but received or actual (type:[%T]) : [\"%v\"]"

func ExpectingErrorSimpleNoType

func ExpectingErrorSimpleNoType(
	title,
	wasExpecting,
	actual interface{},
) error

func ExpectingNotEqualSimpleNoType

func ExpectingNotEqualSimpleNoType(
	title,
	wasExpecting,
	actual interface{},
) string

func ExpectingSimple

func ExpectingSimple(title, wasExpecting, actual interface{}) string

ExpectingSimple

returns

"%s - Expect (type:\"%T\")[\"%v\"] != [\"%v\"](type:\"%T\") Actual"

func ExpectingSimpleNoType

func ExpectingSimpleNoType(title, wasExpecting, actual interface{}) string

ExpectingSimpleNoType

returns

"%s - Expect [\"%v\"] != [\"%v\"] Actual"

func ExpectingSimpleNoTypeError added in v0.9.6

func ExpectingSimpleNoTypeError(title, wasExpecting, actual interface{}) error

func FailedPrint

func FailedPrint(
	isFailed bool,
	items ...interface{},
)

func FmtDebug

func FmtDebug(
	format string,
	items ...interface{},
)

func FmtDebugIf

func FmtDebugIf(
	isDebug bool,
	format string,
	items ...interface{},
)

func GetActualAndExpectProcessedMessage

func GetActualAndExpectProcessedMessage(
	counter int,
	actual interface{},
	expected interface{},
	actualProcessed interface{},
	expectedProcessed interface{},
) string

func GetSearchLineNumberExpectationMessage

func GetSearchLineNumberExpectationMessage(
	counter int,
	lineNumberExpect int,
	lineNumberActualContent int,
	content interface{},
	searchTerm interface{},
	additionalInfo interface{},
) string

func GetSearchTermExpectationMessage

func GetSearchTermExpectationMessage(
	counter int,
	expectationMessage string,
	lineProcessingIndex int,
	contentProcessed interface{},
	searchTermProcessed interface{},
	additionalInfo interface{},
) string

func GetSearchTermExpectationSimpleMessage

func GetSearchTermExpectationSimpleMessage(
	counter int,
	expectationErrorMessage string,
	processingIndex int,
	contentProcessed interface{},
	searchTermProcessed interface{},
) string

func GetWhenActualAndExpectProcessedMessage

func GetWhenActualAndExpectProcessedMessage(
	actual interface{},
	expectationMessageDef *ExpectationMessageDef,
) string

func GherkinsString

func GherkinsString(
	testCaseIndex int,
	feature,
	given,
	when,
	then interface{},
) string

func GherkinsStringWithExpectation

func GherkinsStringWithExpectation(
	testCaseIndex int,
	feature,
	given,
	when,
	then,
	actual,
	expectation interface{},
) string

func HandleCompiledErrorGetter added in v1.1.9

func HandleCompiledErrorGetter(errGetter compiledErrorGetter)

func HandleCompiledErrorWithTracesGetter added in v1.1.9

func HandleCompiledErrorWithTracesGetter(errGetter compiledErrorWithTracesGetter)

func HandleErr added in v1.1.0

func HandleErr(err error)

func HandleErrMessage added in v1.1.0

func HandleErrMessage(errMsg string)

func HandleErrorGetter added in v1.1.9

func HandleErrorGetter(errGetter errorGetter)

func HandleFullStringsWithTracesGetter added in v1.1.9

func HandleFullStringsWithTracesGetter(errGetter fullStringWithTracesGetter)

func ManyErrorToSingle

func ManyErrorToSingle(errorItems []error) error

func ManyErrorToSingleDirect

func ManyErrorToSingleDirect(errorItems ...error) error

func MeaningfulError

func MeaningfulError(
	rawErrType RawErrorType,
	funcName string,
	err error,
) error

func MeaningfulErrorHandle

func MeaningfulErrorHandle(
	rawErrType RawErrorType,
	funcName string,
	err error,
)

func MeaningfulErrorWithData

func MeaningfulErrorWithData(
	rawErrType RawErrorType,
	funcName string,
	err error,
	data interface{},
) error

func MeaningfulMessageError

func MeaningfulMessageError(
	rawErrType RawErrorType,
	funcName string,
	err error,
	message string,
) error

func MergeErrors added in v0.9.8

func MergeErrors(errorItems ...error) error

func MergeErrorsToString added in v0.9.8

func MergeErrorsToString(
	joiner string,
	errorItems ...error,
) string

func MergeErrorsToStringDefault added in v0.9.8

func MergeErrorsToStringDefault(
	errorItems ...error,
) string

func MessageNameValues

func MessageNameValues(
	message string,
	nameValues ...namevalue.Instance,
) string

func MessageVarMap

func MessageVarMap(
	message string,
	mappedItems map[string]interface{},
) string

func MessageVarThree added in v1.1.0

func MessageVarThree(
	message string,
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
	var3 string,
	val3 interface{},
) string

func MessageVarTwo added in v1.1.0

func MessageVarTwo(
	message string,
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
) string

func MessageWithRef

func MessageWithRef(msg string, reference interface{}) string

func MessageWithRefToError

func MessageWithRefToError(msg string, reference interface{}) error

func MsgHeader

func MsgHeader(
	items ...interface{},
) string

func MsgHeaderIf

func MsgHeaderIf(
	isHeader bool,
	items ...interface{},
) string

func MsgHeaderPlusEnding

func MsgHeaderPlusEnding(
	header, message interface{},
) string

func MustBeEmpty added in v1.1.0

func MustBeEmpty(err error)

func PanicOnIndexOutOfRange

func PanicOnIndexOutOfRange(length int, indexes []int)

func PanicRangeNotMeet

func PanicRangeNotMeet(
	otherMsg string,
	rangeStart interface{},
	rangeEnd interface{},
	wholeRange interface{},
) string

func PathMeaningfulError added in v0.9.5

func PathMeaningfulError(
	rawErrType RawErrorType,
	funcName string,
	err error,
	location string,
) error

func PathMeaningfulMessage added in v0.9.5

func PathMeaningfulMessage(
	rawErrType RawErrorType,
	funcName string,
	location string,
	messages ...string,
) error

PathMeaningfulMessage skip error if messages empty or length 0

func RangeNotMeet

func RangeNotMeet(
	otherMsg string,
	rangeStart interface{},
	rangeEnd interface{},
	wholeRange interface{},
) string

func Ref

func Ref(reference interface{}) string

func RefToError

func RefToError(reference interface{}) error

func SimpleHandleErr

func SimpleHandleErr(err error, msg string)

func SimpleHandleErrMany

func SimpleHandleErrMany(msg string, errorItems ...error)

func SliceError

func SliceError(sep string, slice *[]string) error

func SliceErrorDefault

func SliceErrorDefault(slice *[]string) error

func SliceErrorsToStrings

func SliceErrorsToStrings(
	errorItems ...error,
) []string

func SliceToError

func SliceToError(errorSlice []string) error

func SliceToErrorPtr

func SliceToErrorPtr(errorSlice *[]string) error

func SourceDestination added in v1.1.0

func SourceDestination(
	isIncludeType bool,
	srcVal,
	destinationVal interface{},
) string

func SourceDestinationErr added in v1.1.0

func SourceDestinationErr(
	isIncludeType bool,
	srcVal,
	destinationVal interface{},
) error

func SourceDestinationNoType added in v1.1.0

func SourceDestinationNoType(
	srcVal,
	destinationVal interface{},
) string

func StackTracesCompiled

func StackTracesCompiled(traces []string) string

StackTracesCompiled

CodeStacksHeaderNewLine + PrefixStackTrace + JoinedWith(PrefixStackTraceNewLine)

Example:

  • "Code Stack :\n- JoinLinesWith(\n- )"

func StringLinesToQuoteLines

func StringLinesToQuoteLines(lines []string) []string

StringLinesToQuoteLines

Each line will be wrapped with "\"%s\", quotation and comma

func StringLinesToQuoteLinesToSingle

func StringLinesToQuoteLinesToSingle(lines []string) string

StringLinesToQuoteLinesToSingle

Each line will be wrapped with "\"%s\", quotation and comma

func ToError added in v1.1.3

func ToError(errMessage string) error

func ToExitError added in v0.9.8

func ToExitError(err error) *exec.ExitError

func ToString

func ToString(err error) string

func ToStringPtr

func ToStringPtr(err error) *string

func ToValueString

func ToValueString(reference interface{}) string

func ValidPrint

func ValidPrint(
	isValid bool,
	items ...interface{},
)

func VarMap

func VarMap(
	mappedItems map[string]interface{},
) string

func VarMapStrings

func VarMapStrings(
	mappedItems map[string]interface{},
) []string

func VarNameValues

func VarNameValues(
	nameValues ...namevalue.Instance,
) string

func VarNameValuesJoiner

func VarNameValuesJoiner(
	joiner string,
	nameValues ...namevalue.Instance,
) string

func VarNameValuesStrings

func VarNameValuesStrings(
	nameValues ...namevalue.Instance,
) []string

func VarThree added in v1.1.0

func VarThree(
	isIncludeType bool,
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
	var3 string,
	val3 interface{},
) string

func VarThreeNoType added in v1.1.0

func VarThreeNoType(
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
	var3 string,
	val3 interface{},
) string

func VarTwo added in v1.1.0

func VarTwo(
	isIncludeType bool,
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
) string

func VarTwoNoType added in v1.1.0

func VarTwoNoType(
	var1 string,
	val1 interface{},
	var2 string,
	val2 interface{},
) string

Types

type CountStateChangeTracker added in v1.1.9

type CountStateChangeTracker struct {
	// contains filtered or unexported fields
}

func NewCountStateChangeTracker added in v1.1.9

func NewCountStateChangeTracker(
	lengthGetter lengthGetter,
) CountStateChangeTracker

func (CountStateChangeTracker) HasChanges added in v1.1.9

func (it CountStateChangeTracker) HasChanges() bool

func (CountStateChangeTracker) IsFailed added in v1.1.9

func (it CountStateChangeTracker) IsFailed() bool

func (CountStateChangeTracker) IsSameState added in v1.1.9

func (it CountStateChangeTracker) IsSameState() bool

func (CountStateChangeTracker) IsSameStateUsingCount added in v1.1.9

func (it CountStateChangeTracker) IsSameStateUsingCount(
	currentCount int,
) bool

func (CountStateChangeTracker) IsSuccess added in v1.1.9

func (it CountStateChangeTracker) IsSuccess() bool

func (CountStateChangeTracker) IsValid added in v1.1.9

func (it CountStateChangeTracker) IsValid() bool

type ErrAnyFunc

type ErrAnyFunc func() (anyItem interface{}, err error)

type ErrAnyItemsFunc

type ErrAnyItemsFunc func() (anyItems []interface{}, err error)

type ErrBytesFunc

type ErrBytesFunc func() (rawBytes []byte, err error)

type ErrFunc

type ErrFunc func() error

type ErrInAnyFunc

type ErrInAnyFunc func(anyItem interface{}) (err error)

type ErrStringFunc

type ErrStringFunc func() (line string, err error)

type ErrStringsFunc

type ErrStringsFunc func() (lines []string, err error)

type ExpectationMessageDef

type ExpectationMessageDef struct {
	CaseIndex         int
	FuncName          string
	TestCaseName      string
	When              string
	Expected          interface{}
	ActualProcessed   interface{}
	ExpectedProcessed interface{}
	IsNonWhiteSort    bool
	// contains filtered or unexported fields
}

func (ExpectationMessageDef) ExpectedSafeString

func (it ExpectationMessageDef) ExpectedSafeString() string

func (ExpectationMessageDef) ExpectedString

func (it ExpectationMessageDef) ExpectedString() string

func (ExpectationMessageDef) ExpectedStringTrim

func (it ExpectationMessageDef) ExpectedStringTrim() string

func (ExpectationMessageDef) Print

func (it ExpectationMessageDef) Print(actual interface{})

func (ExpectationMessageDef) PrintIf

func (it ExpectationMessageDef) PrintIf(
	isPrint bool,
	actual interface{},
)

func (ExpectationMessageDef) PrintIfFailed

func (it ExpectationMessageDef) PrintIfFailed(
	isPrintOnFail,
	isFailed bool,
	actual interface{},
)

func (ExpectationMessageDef) ToString

func (it ExpectationMessageDef) ToString(actual interface{}) string

type ExpectingRecord

type ExpectingRecord struct {
	ExpectingTitle string
	WasExpecting   interface{}
}

func ExpectingFuture

func ExpectingFuture(title string, wasExpecting interface{}) *ExpectingRecord

ExpectingFuture

returns ExpectingRecord which will print

"%s - expecting (type:[%T]) : [\"%v\"], but received or actual (type:[%T]) : [\"%v\"]"

func (*ExpectingRecord) Error

func (it *ExpectingRecord) Error(actual interface{}) error

Error Expecting

returns

"%s - expecting (type:[%T]) : [\"%v\"], but received or actual (type:[%T]) : [\"%v\"]"

func (*ExpectingRecord) ErrorSimple

func (it *ExpectingRecord) ErrorSimple(actual interface{}) error

ErrorSimple Expecting

returns

"%s - Expect (type:\"%T\")[\"%v\"] != [\"%v\"](type:\"%T\") Actual"

func (*ExpectingRecord) ErrorSimpleNoType

func (it *ExpectingRecord) ErrorSimpleNoType(actual interface{}) error

ErrorSimpleNoType Expecting

returns

"%s - Expect [\"%v\"] != [\"%v\"] Actual"

func (*ExpectingRecord) Message

func (it *ExpectingRecord) Message(actual interface{}) string

Message Expecting

returns

"%s - expecting (type:[%T]) : [\"%v\"], but received or actual (type:[%T]) : [\"%v\"]"

func (*ExpectingRecord) MessageSimple

func (it *ExpectingRecord) MessageSimple(actual interface{}) string

MessageSimple Expecting

returns

"%s - Expect (type:\"%T\")[\"%v\"] != [\"%v\"](type:\"%T\") Actual"

func (*ExpectingRecord) MessageSimpleNoType

func (it *ExpectingRecord) MessageSimpleNoType(actual interface{}) string

MessageSimpleNoType

returns

"%s - Expect [\"%v\"] != [\"%v\"] Actual"

type RawErrCollection

type RawErrCollection struct {
	Items []error
}

func (*RawErrCollection) Add

func (it *RawErrCollection) Add(err error)

func (*RawErrCollection) AddCompiledErrorGetters added in v1.1.9

func (it *RawErrCollection) AddCompiledErrorGetters(
	errorGetter ...compiledErrorGetter,
)

func (*RawErrCollection) AddError added in v1.1.9

func (it *RawErrCollection) AddError(err error)

func (*RawErrCollection) AddErrorGetters added in v1.1.9

func (it *RawErrCollection) AddErrorGetters(
	errorGetter ...errorGetter,
)

func (RawErrCollection) AddErrorWithMessage added in v1.3.18

func (it RawErrCollection) AddErrorWithMessage(
	err error,
	message string,
)

func (RawErrCollection) AddErrorWithMessageRef added in v1.3.18

func (it RawErrCollection) AddErrorWithMessageRef(
	err error,
	message string,
	reference interface{},
)

func (RawErrCollection) AddErrors added in v1.1.9

func (it RawErrCollection) AddErrors(errs ...error)

func (RawErrCollection) AddMessages added in v1.3.18

func (it RawErrCollection) AddMessages(
	messages ...string,
)

func (RawErrCollection) AddMsg added in v1.3.18

func (it RawErrCollection) AddMsg(message string)

func (*RawErrCollection) AddString added in v1.1.9

func (it *RawErrCollection) AddString(
	message string,
)

AddString

Empty string will be ignored

func (*RawErrCollection) AddStringSliceAsErr added in v1.1.9

func (it *RawErrCollection) AddStringSliceAsErr(
	errSliceStrings ...string,
)

func (*RawErrCollection) AddWithCompiledTraceRef

func (it *RawErrCollection) AddWithCompiledTraceRef(
	err error,
	compiledTrace string,
	referenceItem interface{},
)

func (*RawErrCollection) AddWithRef

func (it *RawErrCollection) AddWithRef(
	err error,
	referenceItem interface{},
)

func (*RawErrCollection) AddWithTraceRef

func (it *RawErrCollection) AddWithTraceRef(
	err error,
	traces []string,
	referenceItem interface{},
)

func (*RawErrCollection) Adds

func (it *RawErrCollection) Adds(
	errorItems ...error,
)

func (*RawErrCollection) Clear

func (it *RawErrCollection) Clear()

func (RawErrCollection) Compile added in v1.2.1

func (it RawErrCollection) Compile() string

func (RawErrCollection) CompiledError

func (it RawErrCollection) CompiledError() error

func (RawErrCollection) CompiledErrorUsingJoiner

func (it RawErrCollection) CompiledErrorUsingJoiner(joiner string) error

func (RawErrCollection) CompiledErrorUsingJoinerAdditionalMessage

func (it RawErrCollection) CompiledErrorUsingJoinerAdditionalMessage(joiner, additionalMessage string) error

func (RawErrCollection) CompiledErrorUsingStackTraces

func (it RawErrCollection) CompiledErrorUsingStackTraces(joiner string, stackTraces []string) error

func (RawErrCollection) CompiledErrorWithStackTraces added in v1.2.1

func (it RawErrCollection) CompiledErrorWithStackTraces() error

func (RawErrCollection) CompiledJsonErrorWithStackTraces added in v1.3.15

func (it RawErrCollection) CompiledJsonErrorWithStackTraces() error

func (RawErrCollection) CompiledJsonStringWithStackTraces added in v1.3.15

func (it RawErrCollection) CompiledJsonStringWithStackTraces() (jsonString string)

func (RawErrCollection) CompiledStackTracesString added in v1.2.1

func (it RawErrCollection) CompiledStackTracesString() string

func (RawErrCollection) ConditionalAddError added in v1.1.9

func (it RawErrCollection) ConditionalAddError(isAdd bool, err error)

func (RawErrCollection) CountStateChangeTracker added in v1.1.9

func (it RawErrCollection) CountStateChangeTracker() CountStateChangeTracker

func (*RawErrCollection) Dispose

func (it *RawErrCollection) Dispose()

func (RawErrCollection) ErrorString added in v1.2.1

func (it RawErrCollection) ErrorString() string

func (RawErrCollection) Fmt added in v1.3.18

func (it RawErrCollection) Fmt(format string, v ...interface{})

func (RawErrCollection) FmtIf added in v1.3.18

func (it RawErrCollection) FmtIf(
	isAdd bool,
	format string,
	v ...interface{},
)

func (RawErrCollection) FullString added in v1.2.1

func (it RawErrCollection) FullString() string

func (RawErrCollection) FullStringSplitByNewLine added in v1.2.1

func (it RawErrCollection) FullStringSplitByNewLine() []string

func (RawErrCollection) FullStringWithTraces added in v1.2.1

func (it RawErrCollection) FullStringWithTraces() string

func (RawErrCollection) FullStringWithTracesIf added in v1.2.1

func (it RawErrCollection) FullStringWithTracesIf(isStackTraces bool) string

func (RawErrCollection) FullStringWithoutReferences added in v1.2.1

func (it RawErrCollection) FullStringWithoutReferences() string

func (RawErrCollection) HandleError added in v1.2.1

func (it RawErrCollection) HandleError()

func (RawErrCollection) HandleErrorWithMsg added in v1.2.1

func (it RawErrCollection) HandleErrorWithMsg(newMessage string)

func (RawErrCollection) HandleErrorWithRefs added in v1.2.1

func (it RawErrCollection) HandleErrorWithRefs(
	newMessage string,
	refVar, refVal interface{},
)

func (*RawErrCollection) HasAnyError added in v1.1.9

func (it *RawErrCollection) HasAnyError() bool

func (RawErrCollection) HasAnyIssues added in v1.3.15

func (it RawErrCollection) HasAnyIssues() bool

func (*RawErrCollection) HasError

func (it *RawErrCollection) HasError() bool

func (*RawErrCollection) IsAnyNull added in v1.2.1

func (it *RawErrCollection) IsAnyNull() bool

func (RawErrCollection) IsCollectionType added in v1.3.15

func (it RawErrCollection) IsCollectionType() bool

func (RawErrCollection) IsDefined added in v1.3.15

func (it RawErrCollection) IsDefined() bool

func (*RawErrCollection) IsEmpty

func (it *RawErrCollection) IsEmpty() bool

func (RawErrCollection) IsErrorsCollected added in v1.1.9

func (it RawErrCollection) IsErrorsCollected(
	errorsItems ...error,
) bool

func (RawErrCollection) IsFailed added in v1.1.9

func (it RawErrCollection) IsFailed() bool

func (RawErrCollection) IsInvalid added in v1.1.9

func (it RawErrCollection) IsInvalid() bool

func (*RawErrCollection) IsNull added in v1.2.1

func (it *RawErrCollection) IsNull() bool

func (RawErrCollection) IsSuccess added in v1.1.9

func (it RawErrCollection) IsSuccess() bool

func (RawErrCollection) IsValid added in v1.1.9

func (it RawErrCollection) IsValid() bool

func (*RawErrCollection) Length

func (it *RawErrCollection) Length() int

func (RawErrCollection) Log added in v1.2.1

func (it RawErrCollection) Log()

func (RawErrCollection) LogFatal added in v1.2.1

func (it RawErrCollection) LogFatal()

func (RawErrCollection) LogFatalWithTraces added in v1.2.1

func (it RawErrCollection) LogFatalWithTraces()

func (RawErrCollection) LogIf added in v1.2.1

func (it RawErrCollection) LogIf(isLog bool)

func (RawErrCollection) LogWithTraces added in v1.2.1

func (it RawErrCollection) LogWithTraces()

func (RawErrCollection) MarshalJSON added in v1.2.1

func (it RawErrCollection) MarshalJSON() ([]byte, error)

func (RawErrCollection) MustBeEmptyError added in v1.3.15

func (it RawErrCollection) MustBeEmptyError()

func (RawErrCollection) MustBeSafe added in v1.3.15

func (it RawErrCollection) MustBeSafe()

func (RawErrCollection) References added in v1.3.18

func (it RawErrCollection) References(
	message string,
	v ...interface{},
)

func (RawErrCollection) ReferencesCompiledString added in v1.2.1

func (it RawErrCollection) ReferencesCompiledString() string

func (RawErrCollection) ReflectSetTo added in v1.3.15

func (it RawErrCollection) ReflectSetTo(toPtr interface{}) error

func (RawErrCollection) Serialize added in v1.2.1

func (it RawErrCollection) Serialize() ([]byte, error)

func (RawErrCollection) SerializeMust added in v1.2.1

func (it RawErrCollection) SerializeMust() []byte

func (RawErrCollection) SerializeWithoutTraces added in v1.2.1

func (it RawErrCollection) SerializeWithoutTraces() ([]byte, error)

func (RawErrCollection) String

func (it RawErrCollection) String() string

func (RawErrCollection) StringUsingJoiner

func (it RawErrCollection) StringUsingJoiner(joiner string) string

func (RawErrCollection) StringUsingJoinerAdditional

func (it RawErrCollection) StringUsingJoinerAdditional(joiner, additionalMessage string) string

func (RawErrCollection) StringWithAdditionalMessage

func (it RawErrCollection) StringWithAdditionalMessage(additionalMessage string) string

func (RawErrCollection) Strings

func (it RawErrCollection) Strings() []string

func (RawErrCollection) ToRawErrCollection added in v1.1.9

func (it RawErrCollection) ToRawErrCollection() *RawErrCollection

func (RawErrCollection) UnmarshalJSON added in v1.2.1

func (it RawErrCollection) UnmarshalJSON(data []byte) error

func (RawErrCollection) Value added in v1.2.1

func (it RawErrCollection) Value() error

type RawErrorType added in v0.9.5

type RawErrorType string
const (
	InvalidRequestType                         RawErrorType = "Invalid : request, cannot process it."
	InvalidNullPointerType                     RawErrorType = "Invalid : null pointer, cannot process it."
	InvalidEmptyValueType                      RawErrorType = "Invalid : empty value given, cannot process it."
	OutOfRangeType                             RawErrorType = "Out of range : given value, cannot process it."
	OutOfRangeLengthType                       RawErrorType = "Out of range : given data length, cannot process it."
	InvalidEmptyPathType                       RawErrorType = "Invalid : empty path given, cannot process it."
	InvalidStringType                          RawErrorType = "Invalid : string cannot process it."
	InvalidIntegerType                         RawErrorType = "Invalid : integer cannot process it."
	InvalidFloatType                           RawErrorType = "Invalid : float cannot process it."
	InvalidType                                RawErrorType = "Invalid : type cannot process it."
	InvalidPointerType                         RawErrorType = "Invalid : pointer cannot process it."
	InvalidValueType                           RawErrorType = "Invalid : value cannot process it."
	InvalidCharType                            RawErrorType = "Invalid : character cannot process it."
	InvalidArgumentsType                       RawErrorType = "Invalid : arguments or argument cannot process it."
	InvalidAnyPathEmptyType                    RawErrorType = "Invalid : any of the given path was empty, thus cannot process it."
	UnsupportedOperatingSystemType             RawErrorType = "Unsupported : given operating system is not supported by the executable or system!"
	UnsupportedArchitectureType                RawErrorType = "Unsupported : given operating system architecture is not supported by the executable or system!"
	UnsupportedCategoryType                    RawErrorType = "Unsupported : given category or type or variant is not supported by the executable or system!"
	UnsupportedVersionType                     RawErrorType = "Unsupported : given version request is not supported by the executable or system!"
	UnsupportedInLinuxType                     RawErrorType = "Unsupported : given request is not supported in Linux!"
	UnsupportedInUnixType                      RawErrorType = "Unsupported : given request is not supported in any of Unix (including Linux, macOs, CentOS etc) operating versions!"
	UnsupportedInWindowsType                   RawErrorType = "Unsupported : given request is not supported in any of Windows operating system versions!"
	FailedToExecuteType                        RawErrorType = "Failed : request failed to execute!"
	FailedToCreateCmdType                      RawErrorType = "Failed : To create cmd, command process call. Nil pointer! Cannot proceed further."
	FailedToParseType                          RawErrorType = "Failed : request failed to parse!"
	FailedToConvertType                        RawErrorType = "Failed : request failed to convert!"
	CannotRemoveIndexesFromEmptyCollectionType RawErrorType = "Invalid operation: cannot remove indexes (either indexes are nil) or cannot remove indexes from the empty collection."
	CannotBeNegativeIndexType                  RawErrorType = "Invalid operation or index: index cannot be negative, operations canceled."
	CannotBeNegativeType                       RawErrorType = "Values or value cannot be negative value."
	CannotBeNilOrEmptyType                     RawErrorType = "Values or value cannot be nil or null or empty."
	AlreadyInitializedType                     RawErrorType = "Value is already initialized."
	KeyNotExistInMapType                       RawErrorType = "Key doesn't exist in map."
	CannotBeNilType                            RawErrorType = "Values or value cannot be nil or null."
	ShouldBePointerType                        RawErrorType = "Reference or Input needs to be a pointer!"
	CannotConvertToRwxWhereVarRwxPossibleType  RawErrorType = "Cannot convert Rwx, it had wildcards in type. It can only be converted to VarRwx."
	ShouldBeNilType                            RawErrorType = "Values or value should be nil or null."
	ShouldBeLessThanType                       RawErrorType = "Values or value should be less than the reference."
	ShouldBeGreaterThanType                    RawErrorType = "Values or value should be greater than the reference."
	ShouldBeLessThanEqualType                  RawErrorType = "Values or value should be less or equal to the reference."
	ShouldBeEqualToType                        RawErrorType = "Values or value should be equal to the reference."
	LengthShouldBeEqualToType                  RawErrorType = "Values' or value's length should be equal to the reference."
	EmptyStatusType                            RawErrorType = "Empty status found."
	NullResultType                             RawErrorType = "Null or null or nil pointer, which is unexpected."
	EmptyArrayType                             RawErrorType = "Empty array, which is unexpected."
	EmptyItemsType                             RawErrorType = "Empty items, which is unexpected."
	PathErrorType                              RawErrorType = "Path error, which is unexpected."
	PathRemoveFailedType                       RawErrorType = "Path remove failed."
	PathCreateFailedType                       RawErrorType = "Path create failed."
	FileCloseFailedType                        RawErrorType = "File close failed."
	PathExpandFailedType                       RawErrorType = "Path expand failed."
	PathChmodMismatchErrorType                 RawErrorType = "Path chmod doesn't match as expected. IsMatchesExpectation mismatch error."
	PathInvalidErrorType                       RawErrorType = "Path is missing or have permission issues in the location given."
	PathChmodApplyType                         RawErrorType = "Path chmod apply error."
	PathChmodConvertFailedType                 RawErrorType = "Path chmod convert failed to octal."
	UnexpectedValueType                        RawErrorType = "Unexpected value error, which is unexpected."
	UnexpectedType                             RawErrorType = "Unexpected type error, which is unexpected."
	UnsupportedType                            RawErrorType = "Unsupported type, none of the type matches."
	IntegerOutOfRangeType                      RawErrorType = "Integer out of range. Range, which is unexpected."
	FloatOutOfRangeType                        RawErrorType = "Float out of range. Range, which is unexpected."
	StringOutOfRangeType                       RawErrorType = "ToFileModeString out of range. Range, which is unexpected."
	ShouldBeGreaterThanEqualType               RawErrorType = "Values or value should be greater or equal to the reference."
	UnixIgnoreType                             RawErrorType = "Windows tests ignored in Unix."
	WindowsIgnoreType                          RawErrorType = "Unix tests ignored in Windows."
	ComparatorShouldBeWithinRangeType          RawErrorType = "Comparator should be within the range."
	CannotModifyCompleteResourceType           RawErrorType = "Cannot modify complete or frozen resource."
	EnumValuesOutOfRangeType                   RawErrorType = "Out of Range or Invalid Range: Enum values are are not within the range as per the expectation."
	SearchInputEmptyType                       RawErrorType = "Search Input is either null or empty."
	SearchInputOrSearchTermEmptyType           RawErrorType = "Search Input or search term either null or empty."
	EmptyResultCannotMakeJsonType              RawErrorType = "Empty result, cannot make json out of it."
	MarshallingFailedType                      RawErrorType = "Failed to marshal or serialize."
	UnMarshallingFailedType                    RawErrorType = "Failed to unmarshal or deserialize."
	Serialize                                  RawErrorType = "Failed to serialize or marshal convert to bytes."
	Deserialize                                RawErrorType = "Failed to deserialize or unmarshal convert to object from bytes."
	ParsingFailedType                          RawErrorType = "Failed to parse."
	TypeMismatchType                           RawErrorType = "TypeMismatchType: Type is not as expected."
	NotImplementedType                         RawErrorType = "Not Implemented: Feature or method is not implemented yet."
	NotSupportedType                           RawErrorType = "Not Supported: Feature or method is not supported yet."
	RangesOnlySupportedType                    RawErrorType = "Only Ranges: Only selected ranges supported for the function or feature."
	PathsMissingOrHavingIssuesType             RawErrorType = "Path missing or having other access issues!"
	BytesAreNilOrEmptyType                     RawErrorType = "Bytes data either nil or empty."
	ValidataionFailedType                      RawErrorType = "Validation failed!"
	LengthIssueType                            RawErrorType = "Length Issue!"
)

func GetSet

func GetSet(
	isCondition bool,
	trueValue RawErrorType,
	falseValue RawErrorType,
) RawErrorType

func GetSetVariant

func GetSetVariant(
	isCondition bool,
	trueValue string,
	falseValue string,
) RawErrorType

func (RawErrorType) Combine added in v0.9.5

func (it RawErrorType) Combine(
	otherMsg string, reference interface{},
) string

func (RawErrorType) CombineWithAnother added in v0.9.5

func (it RawErrorType) CombineWithAnother(
	another RawErrorType,
	otherMsg string,
	reference interface{},
) RawErrorType

func (RawErrorType) Error added in v0.9.5

func (it RawErrorType) Error(otherMsg string, reference interface{}) error

func (RawErrorType) ErrorNoRefs added in v0.9.5

func (it RawErrorType) ErrorNoRefs(otherMsg string) error

func (RawErrorType) ErrorRefOnly added in v0.9.5

func (it RawErrorType) ErrorRefOnly(reference interface{}) error

func (RawErrorType) Expecting added in v0.9.5

func (it RawErrorType) Expecting(expecting, actual interface{}) error

func (RawErrorType) Fmt added in v1.3.15

func (it RawErrorType) Fmt(
	format string,
	v ...interface{},
) error

func (RawErrorType) FmtIf added in v1.3.15

func (it RawErrorType) FmtIf(
	isError bool,
	format string,
	v ...interface{},
) error

func (RawErrorType) HandleUsingPanic added in v0.9.5

func (it RawErrorType) HandleUsingPanic(otherMsg string, reference interface{})

func (RawErrorType) MergeError added in v1.3.15

func (it RawErrorType) MergeError(
	err error,
) error

func (RawErrorType) MergeErrorWithMessage added in v1.3.15

func (it RawErrorType) MergeErrorWithMessage(
	err error,
	message string,
) error

func (RawErrorType) MergeErrorWithMessageRef added in v1.3.15

func (it RawErrorType) MergeErrorWithMessageRef(
	err error,
	message string,
	reference interface{},
) error

func (RawErrorType) MergeErrorWithRef added in v1.3.15

func (it RawErrorType) MergeErrorWithRef(
	err error,
	reference interface{},
) error

func (RawErrorType) MsgCsvRef added in v0.9.5

func (it RawErrorType) MsgCsvRef(
	otherMsg string,
	csvReferenceItems ...interface{},
) string

func (RawErrorType) MsgCsvRefError added in v0.9.5

func (it RawErrorType) MsgCsvRefError(
	otherMsg string,
	csvReferenceItems ...interface{},
) error

func (RawErrorType) NoRef added in v0.9.5

func (it RawErrorType) NoRef(otherMsg string) string

func (RawErrorType) SrcDestination added in v1.1.0

func (it RawErrorType) SrcDestination(
	otherMsg string,
	srcName string, srcValue interface{},
	destinationName string, destinationValue interface{},
) string

func (RawErrorType) SrcDestinationErr added in v1.1.0

func (it RawErrorType) SrcDestinationErr(
	otherMsg string,
	srcName string, srcValue interface{},
	destinationName string, destinationValue interface{},
) error

func (RawErrorType) String added in v0.9.5

func (it RawErrorType) String() string

func (RawErrorType) TypesAttach added in v1.1.0

func (it RawErrorType) TypesAttach(
	otherMsg string,
	reflectionTypes ...interface{},
) string

func (RawErrorType) TypesAttachErr added in v1.1.0

func (it RawErrorType) TypesAttachErr(
	otherMsg string,
	reflectionTypes ...interface{},
) error

type TaskWithErrFunc

type TaskWithErrFunc func() error

Source Files

Jump to

Keyboard shortcuts

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