Fix: PyDocs: bpy.ops document behavior on error reports
When submitting #135854 I've assumed that `RuntimeError` is connected particularly to `{'CANCELLED'}` return status. Turned out error is raised regardless of what return status is and it's only based on the presence of error reports during operator execution. Submitting a clarification for this. Pull Request: https://projects.blender.org/blender/blender/pulls/138558
This commit is contained in:
committed by
Pratik Borhade
parent
63cdb7eae4
commit
670fc012e5
@@ -16,7 +16,9 @@ saving an undo history entry.
|
||||
|
||||
If operator was cancelled but there wasn't any reports from it with ``{'ERROR'}`` type,
|
||||
it will just return ``{'CANCELLED'}`` without raising any exceptions.
|
||||
If it had error reports, then it will raise a ``RuntimeError`` including all report messages.
|
||||
However, if there are error reports, a ``RuntimeError`` will be raised
|
||||
after the operator finishes execution, including all error report messages,
|
||||
regardless of the return status (even if it was ``{'FINISHED'}``).
|
||||
|
||||
Calling an operator in the wrong context will raise a ``RuntimeError``,
|
||||
there is a poll() method to avoid this problem.
|
||||
|
||||
Reference in New Issue
Block a user