LogicError
@algorandfoundation/algokit-utils / types/logic-error / LogicError
types/logic-error.LogicError
Wraps key functionality around processing logic errors
Hierarchy
Section titled “Hierarchy”-
Error↳
LogicError
Table of contents
Section titled “Table of contents”Constructors
Section titled “Constructors”Properties
Section titled “Properties”Methods
Section titled “Methods”Constructors
Section titled “Constructors”constructor
Section titled “constructor”• new LogicError(errorDetails, program, getLineForPc): LogicError
Create a new logic error object.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
errorDetails | LogicErrorDetails | The details of the logic error |
program | string[] | The TEAL source code, split by line |
getLineForPc | (pc: number) => undefined | number | The source map of the TEAL source code |
Returns
Section titled “Returns”Overrides
Section titled “Overrides”Error.constructor
Defined in
Section titled “Defined in”Properties
Section titled “Properties”• Optional cause: unknown
Inherited from
Section titled “Inherited from”Error.cause
Defined in
Section titled “Defined in”node_modules/typescript/lib/lib.es2022.error.d.ts:24
• led: LogicErrorDetails
Defined in
Section titled “Defined in”• lines: number = 5
Defined in
Section titled “Defined in”message
Section titled “message”• message: string
Inherited from
Section titled “Inherited from”Error.message
Defined in
Section titled “Defined in”node_modules/typescript/lib/lib.es5.d.ts:1077
• name: string
Inherited from
Section titled “Inherited from”Error.name
Defined in
Section titled “Defined in”node_modules/typescript/lib/lib.es5.d.ts:1076
program
Section titled “program”• program: string[]
Defined in
Section titled “Defined in”• Optional stack: string
Overrides
Section titled “Overrides”Error.stack
Defined in
Section titled “Defined in”teal_line
Section titled “teal_line”• teal_line: number = 0
Defined in
Section titled “Defined in”prepareStackTrace
Section titled “prepareStackTrace”▪ 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
Type declaration
Section titled “Type declaration”▸ (err, stackTraces): any
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
err | Error |
stackTraces | CallSite[] |
Returns
Section titled “Returns”any
Inherited from
Section titled “Inherited from”Error.prepareStackTrace
Defined in
Section titled “Defined in”node_modules/@types/node/globals.d.ts:28
stackTraceLimit
Section titled “stackTraceLimit”▪ Static stackTraceLimit: number
Inherited from
Section titled “Inherited from”Error.stackTraceLimit
Defined in
Section titled “Defined in”node_modules/@types/node/globals.d.ts:30
Methods
Section titled “Methods”captureStackTrace
Section titled “captureStackTrace”▸ captureStackTrace(targetObject, constructorOpt?): void
Create .stack property on a target object
Parameters
Section titled “Parameters”| Name | Type |
|---|---|
targetObject | object |
constructorOpt? | Function |
Returns
Section titled “Returns”void
Inherited from
Section titled “Inherited from”Error.captureStackTrace
Defined in
Section titled “Defined in”node_modules/@types/node/globals.d.ts:21
parseLogicError
Section titled “parseLogicError”▸ parseLogicError(error): undefined | LogicErrorDetails
Takes an error message and parses out the details of any logic errors in there.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
error | any | The error message to parse |
Returns
Section titled “Returns”undefined | LogicErrorDetails
The logic error details if any, or undefined