Specifications

This function returns None.
eraseImage() – Erase any SNAPpy image from the node
This function is used by Portal and SNAPconnect as part of the script upload process, and would not
normally be used by user scripts. Calling this function automatically invokes the resetVm() function
first (otherwise the SNAPpy VM would still be running the script, as you erased it out from under it).
This function takes no parameters, and returns None.
errno() – Read and reset latest error code
This function reads the most recent error code from the SNAPpy Virtual Machine (VM), clearing it
out as it does so. The possible error codes are:
0 = NO_ERROR
1 = OP_NOT_DEFINED
2 = UNSUPPORTED_OPCODE
3 = UNRESOLVED_DEPENDENCY
4 = INCOMPATIBLE_TYPES
5 = TARGET_NOT_CALLABLE
6 = UNBOUND_LOCAL
7 = BAD_GLOBAL_INDEX
8 = EXCEEDED_MAX_BLOCK_STACK
9 = EXCEEDED_MAX_FRAME_STACK
10 = EXCEEDED_MAX_OBJ_STACK
11 = INVALID_FUNC_ARGS
12 = UNSUBSCRIPTABLE_OBJECT
13 = INVALID_SUBSCRIPT
14 = EXCEEDED_MAX_LOCAL_STACK
15 = BAD_CONST_INDEX
16 = ALLOC_REF_UNDERFLOW
17 = ALLOC_REF_OVERFLOW
18 = ALLOC_FAIL
19 = UNSUPPORTED_TYPE
20 = MAX_PACKET_SIZE_EXCEEDED
21 = MAX_STRING_SIZE_EXCEEDED
“Debug” firmware (look for “debug” in the file name) is required for complete error checking.
Some of these error codes are unlikely to occur from user-generated scripts, but a few would point
directly to programming errors in the user’s SNAPpy source code. For example:
INCOMPATIBLE_TYPES: Are you trying to add a number to a string?
TARGET_NOT_CALLABLE: Are you trying to invoke foo(), but foo = 123?
Page 46 of 202 SNAP Reference Manual Document Number 600-0007K