Skip to main content

TIFException

TIFException = (ErNoError, erCannotImport, erInvalidType, ErInternalError, erInvalidHeader, erInvalidOpcode, erInvalidOpcodeParameter, erNoMainProc, erOutOfGlobalVarsRange, erOutOfProcRange, ErOutOfRange, erOutOfStackRange, ErTypeMismatch, erUnexpectedEof, erVersionError, ErDivideByZero, ErMathError, erCouldNotCallProc, erOutofRecordRange, erOutOfMemory, erException, erNullPointerException, erNullVariantError, erInterfaceNotSupported, erCustomError)

Example

procedure ReRaiseLastScriptError;
var
E: TIFException;
begin
E := ExceptionType;
if E <> ErNoError then
RaiseException(E, ExceptionParam);
end;

Usage

TIFException identifies the Velox scripting error category returned, raised and formatted by exception helper functions.

Members

ValueOrdinalMeaning
ErNoError0No stored Velox scripting runtime error.
erCannotImport1A requested external function/class/member could not be imported; the parameter names it.
erInvalidType2value type metadata or an operand type is invalid.
ErInternalError3Velox script-engine consistency failure.
erInvalidHeader4Compiled-script header is invalid.
erInvalidOpcode5Bytecode contains an unsupported/invalid opcode.
erInvalidOpcodeParameter6An opcode operand is invalid.
erNoMainProc7The compiled script has no executable main procedure.
erOutOfGlobalVarsRange8Global-variable index is outside the compiled range.
erOutOfProcRange9Procedure index is outside the compiled range.
ErOutOfRange10General range check failed.
erOutOfStackRange11Stack access is outside the current stack range.
ErTypeMismatch12Runtime values/types are incompatible.
erUnexpectedEof13Compiled data ended before the expected structure was complete.
erVersionError14Compiled data version is incompatible with the runtime.
ErDivideByZero15Integer or floating division attempted with a zero divisor.
ErMathError16Other arithmetic/math error.
erCouldNotCallProc17The VM could not invoke a procedure; a non-empty parameter is appended in parentheses.
erOutofRecordRange18Record-field access is outside the record layout.
erOutOfMemory19The VM or host allocation failed.
erException20A captured host/script exception; formatter inserts the parameter into the exception message.
erNullPointerException21A nil object/pointer was dereferenced.
erNullVariantError22An invalid Null Variant operation occurred.
erInterfaceNotSupported23The requested interface is unavailable.
erCustomError24Custom error; ExceptionToString returns the parameter verbatim.

Behavior and boundaries

  • ExceptionType returns the last stored VM error category. Read the associated parameter, procedure and position before another error overwrites them.
  • RaiseException raises the selected category with the supplied parameter. Use a member whose formatted message expects the parameter you provide.
  • erCustomError exposes its parameter directly as message text; do not place secrets in it when logs or user-visible error channels may record the result.
  • Invalid header, opcode or version errors normally indicate incompatible or damaged compiled script data, not a recoverable business validation failure.
  • Do not persist ordinal values across Velox scripting runtime versions. Store the member name and captured human-readable message.

Additional Technical Info

TIFException is the script-visible declaration of the PascalScript runtime's TPSError. It is used by ExceptionType, RaiseException and ExceptionToString; it is not the Delphi class of the caught exception.

The generated Code Library index stores only 300 declaration characters and ends at ErMathError. Product source registers the complete 25-member declaration shown above.

Related Code Library entries

External references

Created 2026-07-15