errormdl

package
v2.0.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package errormdl will help you catch error

Index

Constants

View Source
const (
	// NOERROR - success Code
	NOERROR = 1000

	// APPLICATION ERRORS
	// SJSONERROR - sjson helper error
	SJSONERROR          = 1001
	KEYNOTFOUND         = 1002
	CASTINGERROR        = 1003
	DATAINVALIDERROR    = 1004
	EMAILERROR          = 1005
	SERVICENOTFOUND     = 1006
	CONDITIONPARSEERROR = 1007
	CONDITIONEVALERROR  = 1008
	NEXTFORMEVALERROR   = 1009

	// DB Errors
	MONGOERROR     = 2001
	MYSQLERROR     = 2002
	SQLSERVERERROR = 2003
	GRAPHDBERROR   = 2004

	// CUSTOM Error
	EXPECTATIONFAILED = 4000
)

Variables

View Source
var IsTestingNegetiveCaseOn bool

IsTestingNegetiveCaseOn mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOn1 bool

IsTestingNegetiveCaseOn1 mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOn2 bool

IsTestingNegetiveCaseOn2 mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOn3 bool

IsTestingNegetiveCaseOn3 mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOnCheckBool bool

IsTestingNegetiveCaseOn mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOnCheckBool1 bool
View Source
var IsTestingNegetiveCaseOnCheckBool2 bool
View Source
var IsTestingNegetiveCaseOnCheckBool3 bool
View Source
var IsTestingNegetiveCaseOnCheckInt bool

IsTestingNegetiveCaseOn mark this on if you want system cases to fail

View Source
var IsTestingNegetiveCaseOnCheckInt1 bool
View Source
var IsTestingNegetiveCaseOnCheckInt2 bool

Functions

func CheckBool

func CheckBool(orginalInput bool) bool

CheckBool will help checking bool condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn flag

func CheckBool1

func CheckBool1(orginalInput bool) bool

func CheckBool2

func CheckBool2(orginalInput bool) bool

func CheckBool3

func CheckBool3(orginalInput bool) bool

func CheckErr

func CheckErr(err error) error

CheckErr will help checking err condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn flag

func CheckErr1

func CheckErr1(err error) error

CheckErr1 condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn1 flag

func CheckErr2

func CheckErr2(err error) error

CheckErr2 condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn2 flag

func CheckErr3

func CheckErr3(err error) error

CheckErr3 condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn3 flag

func CheckInt

func CheckInt(len int) int

CheckInt will help checking int condition for real as well as test cases. It can fail based on IsTestingNegetiveCaseOn flag

func CheckInt1

func CheckInt1(len int) int

func CheckInt2

func CheckInt2(len int) int

Types

type CoreError

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

CoreError is custom error

func Wrap

func Wrap(msg string) *CoreError

Wrap Use wrapper error an not golang

func WrapWithCode

func WrapWithCode(msg string, errorCode int) (int, *CoreError)

WrapWithCode Use wrapper error an not golang

func (*CoreError) Error

func (cerr *CoreError) Error() string

Error is interface method so that this will help compatibility with error

Jump to

Keyboard shortcuts

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