Error Manipulation Opcodes
This section documents instructions for creating and inspecting Error objects in CandleVM.
For operand encodings, see the executable format reference.
Errors
| Opcode byte | Opcode | Operand bytes | Behavior |
|---|---|---|---|
| 61 | NewError | destination: register, message: register | Requires an ObjectRef value to a String, creates a custom CandleVM error containing that string, wraps it in an Error and stores the ObjectRef value. |
| 62 | ErrorType | destination: register, error: register | Requires an Error and stores the name of its CandleVM error type in a newly allocated String. |
| 63 | ErrorMessage | destination: register, error: register | Requires an Error and stores its message in a newly allocated String. For custom errors created by NewError, this is the original message; for other CandleVM errors, it is the runtime-generated message. |