On this page | |
Inheritance |
|
Overview ¶
For example, you might take a reference to a node:
>>> node = hou.node("/obj/geo1/sphere1")
If that node is later deleted, and then you try to use your reference to the deleted node, Houdini will raise this error:
>>> path = node.path() hou.ObjectWasDeleted: ...
Tips and tricks ¶
-
There is no way to check if a reference is still valid, other than to try an operation and catch this error.
-
If you want to keep a long-ish term reference to a node, you might find it more convenient to instead keep a reference to the node’s unique integer ID for the node in this session (hou.Node.sessionId). Then, when you want to use the node again, call hou.nodeBySessionId() with the ID. It will return a reference to the node, or
None
if the node has since been deleted.
¶
Methods from hou.Error ¶
description()
→ str
Return a description of the class of exception. The description is not related to the exception instance.
exceptionTypeName()
→ str
Return the name of the exception type. Instances of different
subclasses of hou.Error will return different names. Instances of the
base class will return "Error"
.
You can also use str(e.__class__)
to get the name of the subclass.
instanceMessage()
→ str
Return a message specific to the exception instance.