Skip to content

LogicError

@algorandfoundation/algokit-utils / types/logic-error / LogicError

types/logic-error.LogicError

Wraps key functionality around processing logic errors

  • Error

    LogicError

new LogicError(errorDetails, program, getLineForPc): LogicError

Create a new logic error object.

NameTypeDescription
errorDetailsLogicErrorDetailsThe details of the logic error
programstring[]The TEAL source code, split by line
getLineForPc(pc: number) => undefined | numberThe source map of the TEAL source code

LogicError

Error.constructor

src/types/logic-error.ts:56

Optional cause: unknown

Error.cause

node_modules/typescript/lib/lib.es2022.error.d.ts:24


led: LogicErrorDetails

src/types/logic-error.ts:44


lines: number = 5

src/types/logic-error.ts:46


message: string

Error.message

node_modules/typescript/lib/lib.es5.d.ts:1077


name: string

Error.name

node_modules/typescript/lib/lib.es5.d.ts:1076


program: string[]

src/types/logic-error.ts:45


Optional stack: string

Error.stack

src/types/logic-error.ts:48


teal_line: number = 0

src/types/logic-error.ts:47


Static Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Optional override for formatting stack traces

See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

▸ (err, stackTraces): any

NameType
errError
stackTracesCallSite[]

any

Error.prepareStackTrace

node_modules/@types/node/globals.d.ts:28


Static stackTraceLimit: number

Error.stackTraceLimit

node_modules/@types/node/globals.d.ts:30

captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

NameType
targetObjectobject
constructorOpt?Function

void

Error.captureStackTrace

node_modules/@types/node/globals.d.ts:21


parseLogicError(error): undefined | LogicErrorDetails

Takes an error message and parses out the details of any logic errors in there.

NameTypeDescription
erroranyThe error message to parse

undefined | LogicErrorDetails

The logic error details if any, or undefined

src/types/logic-error.ts:28