errors

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlignment = NewMessage("invalid.alignment.spec")
View Source
var ErrArgumentCount = NewMessage("arg.count")
View Source
var ErrArgumentType = NewMessage("arg.type")
View Source
var ErrArgumentTypeCheck = NewMessage("argcheck.array")
View Source
var ErrArrayBounds = NewMessage("array.bounds")
View Source
var ErrArrayIndex = NewMessage("array.index")
View Source
var ErrAssert = NewMessage("assert")
View Source
var ErrBlockQuote = NewMessage("invalid.blockquote")
View Source
var ErrCacheSizeNotSpecified = NewMessage("cache.not.spec")
View Source
var ErrCannotDeleteActiveProfile = NewMessage("cannot.delete.profile")
View Source
var ErrCertificateParseError = NewMessage("cert.parse.err")
View Source
var ErrChannelNotOpen = NewMessage("channel.not.open")
View Source
var ErrColumnCount = NewMessage("column.count")
View Source
var ErrContinue = NewMessage("_continue")
View Source
var ErrDatabaseClientClosed = NewMessage("db.closed")
View Source
var ErrDivisionByZero = NewMessage("div.zero")
View Source
var ErrDuplicateColumnName = NewMessage("dup.column")
View Source
var ErrDuplicateTypeName = NewMessage("dup.type")
View Source
var ErrEmptyColumnList = NewMessage("empty.column")
View Source
var ErrExit = NewMessage("_exit")
View Source
var ErrExpiredToken = NewMessage("expired")
View Source
var ErrFunctionAlreadyExists = NewMessage("func.exists")
View Source
var ErrFunctionReturnedVoid = NewMessage("func.void")
View Source
var ErrGeneric = NewMessage("general")
View Source
var ErrHTTP = NewMessage("http")
View Source
var ErrImmutableArray = NewMessage("immutable.array")
View Source
var ErrImmutableMap = NewMessage("immutable.map")
View Source
var ErrImportNotCached = NewMessage("import.not.found")
View Source
var ErrInternalCompiler = NewMessage("compiler")
View Source
var ErrInvalidAuthenticationType = NewMessage("auth.type")
View Source
var ErrInvalidBitShift = NewMessage("bit.shift")
View Source
var ErrInvalidBitSize = NewMessage("bit.size")
View Source
var ErrInvalidBooleanValue = NewMessage("boolean.option")
View Source
var ErrInvalidBreakClause = NewMessage("break.clause")
View Source
var ErrInvalidBytecodeAddress = NewMessage("bytecode.address")
View Source
var ErrInvalidCallFrame = NewMessage("call.frame")
View Source
var ErrInvalidChannel = NewMessage("not.channel")
View Source
var ErrInvalidChannelList = NewMessage("channel.assignment")
View Source
var ErrInvalidColumnDefinition = NewMessage("db.column.def")
View Source
var ErrInvalidColumnName = NewMessage("column.name")
View Source
var ErrInvalidColumnNumber = NewMessage("column.number")
View Source
var ErrInvalidColumnWidth = NewMessage("column.width")
View Source
var ErrInvalidConfigName = NewMessage("profile.name")
View Source
var ErrInvalidConstant = NewMessage("constant")
View Source
var ErrInvalidCredentials = NewMessage("credentials")
View Source
var ErrInvalidDebugCommand = NewMessage("debugger.cmd")
View Source
var ErrInvalidDirective = NewMessage("directive")
View Source
var ErrInvalidField = NewMessage("field.for.type")
View Source
var ErrInvalidFileMode = NewMessage("file.mode")
View Source
var ErrInvalidFormatVerb = NewMessage("format.spec")
View Source
var ErrInvalidFunctionArgument = NewMessage("func.arg")
View Source
var ErrInvalidFunctionCall = NewMessage("func.call")
View Source
var ErrInvalidFunctionName = NewMessage("func.name")
View Source
var ErrInvalidIdentifier = NewMessage("identifier")
View Source
var ErrInvalidImport = NewMessage("import")
View Source
var ErrInvalidInstruction = NewMessage("instruction")
View Source
var ErrInvalidInteger = NewMessage("integer.option")
View Source
var ErrInvalidKeyword = NewMessage("keyword.option")
View Source
var ErrInvalidList = NewMessage("list")
View Source
var ErrInvalidLoggerName = NewMessage("logger.name")
View Source
var ErrInvalidLoopControl = NewMessage("loop.control")
View Source
var ErrInvalidLoopIndex = NewMessage("loop.index")
View Source
var ErrInvalidMediaType = NewMessage("media.type")
View Source
var ErrInvalidOutputFormat = NewMessage("format.type")
View Source
var ErrInvalidPackageName = NewMessage("package.name")
View Source
var ErrInvalidPointerType = NewMessage("pointer.type")
View Source
var ErrInvalidRange = NewMessage("range")
View Source
var ErrInvalidResultSetType = NewMessage("db.result.type")
View Source
var ErrInvalidReturnTypeList = NewMessage("return.list")
View Source
var ErrInvalidReturnValue = NewMessage("return.void")
View Source
var ErrInvalidRowNumber = NewMessage("row.number")
View Source
var ErrInvalidRowSet = NewMessage("db.rowset")
View Source
var ErrInvalidSandboxPath = NewMessage("sandbox.path")
View Source
var ErrInvalidScopeLevel = NewMessage("scope.invalid")
View Source
var ErrInvalidSliceIndex = NewMessage("slice.index")
View Source
var ErrInvalidSpacing = NewMessage("spacing")
View Source
var ErrInvalidStepType = NewMessage("step.type")
View Source
var ErrInvalidStruct = NewMessage("struct")
View Source
var ErrInvalidStructOrPackage = NewMessage("invalid.struct.or.package")
View Source
var ErrInvalidSymbolName = NewMessage("symbol.name")
View Source
var ErrInvalidTemplateName = NewMessage("template.name")
View Source
var ErrInvalidThis = NewMessage("this")
View Source
var ErrInvalidTimer = NewMessage("timer")
View Source
var ErrInvalidTokenEncryption = NewMessage("token.encryption")
View Source
var ErrInvalidType = NewMessage("type")
View Source
var ErrInvalidTypeCheck = NewMessage("type.check")
View Source
var ErrInvalidTypeName = NewMessage("type.name")
View Source
var ErrInvalidTypeSpec = NewMessage("type.spec")
View Source
var ErrInvalidURL = NewMessage("url")
View Source
var ErrInvalidValue = NewMessage("value")
View Source
var ErrInvalidVarType = NewMessage("var.type")
View Source
var ErrInvalidVariableArguments = NewMessage("var.args")
View Source
var ErrInvalidfileIdentifier = NewMessage("file.id")
View Source
var ErrLoggerConflict = NewMessage("logger.conflict")
View Source
var ErrLogonEndpoint = NewMessage("logon.endpoint")
View Source
var ErrLoopBody = NewMessage("for.body")
View Source
var ErrLoopExit = NewMessage("for.exit")
View Source
var ErrMissingAssignment = NewMessage("assignment")
View Source
var ErrMissingBlock = NewMessage("block")
View Source
var ErrMissingBracket = NewMessage("array.bracket")
View Source
var ErrMissingCase = NewMessage("case")
View Source
var ErrMissingCatch = NewMessage("catch")
View Source
var ErrMissingColon = NewMessage("colon")
View Source
var ErrMissingEndOfBlock = NewMessage("block.end")
View Source
var ErrMissingEqual = NewMessage("equals")
View Source
var ErrMissingExpression = NewMessage("expression")
View Source
var ErrMissingForLoopInitializer = NewMessage("for.init")
View Source
var ErrMissingFunction = NewMessage("function")
View Source
var ErrMissingFunctionBody = NewMessage("function.body")
View Source
var ErrMissingFunctionName = NewMessage("function.name")
View Source
var ErrMissingFunctionType = NewMessage("function.return")
View Source
var ErrMissingInterface = NewMessage("interface.imp")
View Source
var ErrMissingLoggerName = NewMessage("logger.name")
View Source
var ErrMissingLoopAssignment = NewMessage("for.assignment")
View Source
var ErrMissingOptionValue = NewMessage("option.value")
View Source
var ErrMissingOutputType = NewMessage("format.type")
View Source
var ErrMissingPackageName = NewMessage("package.name")
View Source
var ErrMissingPackageStatement = NewMessage("package.stmt")
View Source
var ErrMissingParameterList = NewMessage("function.list")
View Source
var ErrMissingParenthesis = NewMessage("parens")
View Source
var ErrMissingReturnValues = NewMessage("function.values")
View Source
var ErrMissingSemicolon = NewMessage("semicolon")
View Source
var ErrMissingStatement = NewMessage("statement")
View Source
var ErrMissingSymbol = NewMessage("symbol.name")
View Source
var ErrMissingTerm = NewMessage("expression.term")
View Source
var ErrMissingType = NewMessage("type.def")
View Source
var ErrNilPointerReference = NewMessage("nil")
View Source
var ErrNoCredentials = NewMessage("credentials.missing")
View Source
var ErrNoFunctionReceiver = NewMessage("function.receiver")
View Source
var ErrNoLogonServer = NewMessage("logon.server")
View Source
var ErrNoMainPackage = NewMessage("no.main.package")
View Source
var ErrNoPrivilegeForOperation = NewMessage("privilege")
View Source
var ErrNoSuchAsset = NewMessage("asset")
View Source
var ErrNoSuchDebugService = NewMessage("debug.service")
View Source
var ErrNoSuchProfile = NewMessage("profile.not.found")
View Source
var ErrNoSuchProfileKey = NewMessage("profile.key")
View Source
var ErrNoSuchTXSymbol = NewMessage("tx.not.found")
View Source
var ErrNoSuchUser = NewMessage("user.not.found")
View Source
var ErrNoTransactionActive = NewMessage("tx.not.active")
View Source
var ErrNotAPointer = NewMessage("not.pointer")
View Source
var ErrNotAService = NewMessage("not.service")
View Source
var ErrNotAType = NewMessage("not.type")
View Source
var ErrNotAnLValueList = NewMessage("not.assignment.list")
View Source
var ErrNotFound = NewMessage("not.found")
View Source
var ErrOpcodeAlreadyDefined = NewMessage("opcode.defined")
View Source
var ErrPackageRedefinition = NewMessage("package.exists")
View Source
var ErrPanic = NewMessage("panic")
View Source
var ErrReadOnly = NewMessage("readonly")
View Source
var ErrReadOnlyValue = NewMessage("readonly.write")
View Source
var ErrRequiredNotFound = NewMessage("option.required")
View Source
var ErrReservedProfileSetting = NewMessage("reserved.name")
View Source
var ErrRestClientClosed = NewMessage("rest.closed")
View Source
var ErrReturnValueCount = NewMessage("func.return.count")
View Source
var ErrServerAlreadyRunning = NewMessage("server.running")
View Source
var ErrSignalDebugger = NewMessage("_signal")
View Source
var ErrStackUnderflow = NewMessage("stack.underflow")
View Source
var ErrStepOver = NewMessage("_step-over")
View Source
var ErrStop = NewMessage("_stop")
View Source
var ErrSymbolExists = NewMessage("symbol.exists")
View Source
var ErrSymbolNotExported = NewMessage("symbol.not.exported")
View Source
var ErrTableClosed = NewMessage("table.closed")
View Source
var ErrTableErrorPrefix = NewMessage("table.processing")
View Source
var ErrTerminatedWithErrors = NewMessage("terminated")
View Source
var ErrTestingAssert = NewMessage("assert.testing")
View Source
var ErrTooManyLocalSymbols = NewMessage("symbol.overflow")
View Source
var ErrTooManyParameters = NewMessage("cli.parms")
View Source
var ErrTooManyReturnValues = NewMessage("func.return.count")
View Source
var ErrTransactionAlreadyActive = NewMessage("tx.active")
View Source
var ErrTryCatchMismatch = NewMessage("try.stack")
View Source
var ErrTypeMismatch = NewMessage("type.mismatch")
View Source
var ErrUndefinedEntrypoint = NewMessage("entry.not.found")
View Source
var ErrUnexpectedParameters = NewMessage("cli.subcommand")
View Source
var ErrUnexpectedTextAfterCommand = NewMessage("cli.extra")
View Source
var ErrUnexpectedToken = NewMessage("token.extra")
View Source
var ErrUnexpectedValue = NewMessage("value.extra")
View Source
var ErrUnimplementedInstruction = NewMessage("bytecode.not.found")
View Source
var ErrUnknownIdentifier = NewMessage("identifier.not.found")
View Source
var ErrUnknownMember = NewMessage("field.not.found")
View Source
var ErrUnknownOption = NewMessage("cli.option")
View Source
var ErrUnknownPackageMember = NewMessage("package.member")
View Source
var ErrUnknownSymbol = NewMessage("symbol.not.found")
View Source
var ErrUnknownType = NewMessage("type.not.found")
View Source
var ErrUnrecognizedCommand = NewMessage("cli.command.not.found")
View Source
var ErrUnrecognizedStatement = NewMessage("statement.not.found")
View Source
var ErrUnusedErrorReturn = NewMessage("func.unused")
View Source
var ErrUserDefined = NewMessage("user.defined")
View Source
var ErrWrongArrayValueType = NewMessage("array.value.type")
View Source
var ErrWrongMapKeyType = NewMessage("map.key.type")
View Source
var ErrWrongMapValueType = NewMessage("map.value.type")
View Source
var ErrWrongMode = NewMessage("directive.mode")
View Source
var ErrWrongParameterCount = NewMessage("parm.count")
View Source
var ErrWrongParameterValueCount = NewMessage("parm.value.count")

Functions

func Equals

func Equals(e1, e2 error) bool

func Nil

func Nil(e error) bool

Nil tests to see if the error is "nil". If it is a native Go error, it is just tested to see if it is nil. If it is an EgoError then additionally we test to see if it is a valid pointer but to a null error, in which case it is also considered a nil value.

Types

type Error

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

Error describes the error structure shared by all of Ego. This includes a wrapped error (which may be from our list of native errors, or a return code from a Go runtime). The context is a string that further explains the cause/source of the error, and is message-specific.

func NewError

func NewError(err error) *Error

NewError creates a new NewError object, and fils in the native wrapped error. Note that if the value passed in is already an NewError, then it is returned without re-wrapping it.

func NewMessage

func NewMessage(m string) *Error

NewMessage create a new EgoError using an arbitrary string. This is used in cases where a fmt.Errorf() was used to generate an error string.

Note that the message text is first checked to see if it is an i18n error key. If so, the localized version of the error message is used. If the message starts with an "_" character, no i18n translation is performed.

func (*Error) At

func (e *Error) At(line int, column int) *Error

At specifies a line number and column position related to the error. The line number is always present, the column is typically only set during compilation; if it is zero then it is not displayed.

func (*Error) Context

func (e *Error) Context(context interface{}) *Error

Context specifies the context value. This is a message- dependent value that further describes the error. For example, in a keyword not recognized error, the context is usually the offending keyword.

func (*Error) Equal

func (e *Error) Equal(v interface{}) bool

Equal comparees an error to an arbitrary object. If the object is not an error, then the result is always false. If it is a native error or an EgoError, the error and wrapped error are compared.

func (*Error) Error

func (e *Error) Error() string

Format an EgoError as a string for human consumption.

func (*Error) GetContext

func (e *Error) GetContext() interface{}

GetContext retrieves the context value for the error.

func (*Error) In

func (e *Error) In(name string) *Error

In specifies the location name. This can be the name of a source code module, or a function name.

func (*Error) Is

func (e *Error) Is(err error) bool

Is compares the current error to the supplied error, and return a boolean indicating if they are the same.

func (*Error) Unwrap

func (e *Error) Unwrap() error

Unwrap retrieves the native or wrapped error from this Error.

Jump to

Keyboard shortcuts

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