Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise more informational error from errors in custom Python chaser #3314

Open
BigRoy opened this issue Sep 6, 2023 · 1 comment
Open

Raise more informational error from errors in custom Python chaser #3314

BigRoy opened this issue Sep 6, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@BigRoy
Copy link
Contributor

BigRoy commented Sep 6, 2023

Is your feature request related to a problem? Please describe.

When an error occurs in a Python chaser the only error given is:

# Error: RuntimeError: Tf Python Exception

It'd be great if instead it could somehow provide a stack trace to the source line of code of the Python class for the tracer.

Reproducable:

import mayaUsd.lib as mayaUsdLib

class CrashChaser(mayaUsdLib.ExportChaser):
    def PostExport(self):
        raise RuntimeError("error")
        return True

mayaUsdLib.ExportChaser.Unregister(CrashChaser, "crash")
mayaUsdLib.ExportChaser.Register(CrashChaser, "crash")

from maya import cmds
cmds.loadPlugin("mayaUsdPlugin", quiet=True)
cmds.mayaUSDExport(file="E:/test.usd",
                   frameRange=(1, 5),
                   frameStride=1.0,
                   chaser=["crash"],
                   selection=True)

Similarly a confusing error is raised if e.g. PostExport method does not return True:

import mayaUsd.lib as mayaUsdLib


class CrashChaser(mayaUsdLib.ExportChaser):
    def PostExport(self):
        pass


mayaUsdLib.ExportChaser.Unregister(CrashChaser, "crash")
mayaUsdLib.ExportChaser.Register(CrashChaser, "crash")

from maya import cmds
cmds.loadPlugin("mayaUsdPlugin", quiet=True)
cmds.mayaUSDExport(file="E:/test.usd",
                   frameRange=(1, 5),
                   frameStride=1.0,
                   chaser=["crash"],
                   selection=True)

Which gives:

# # Traceback (most recent call last):
# #   File "<maya console>", line 14, in <module>
# #   File "<string>", line 2, in mayaUSDExport
# # RuntimeError: Maya command error

Describe the solution you'd like

Improve the error messages for developers so they know what's acting up and how they should continue.

Additional context

The raised errors being unclear was also mentioned here and here.

@BigRoy BigRoy added the enhancement New feature or request label Sep 6, 2023
@neilh-adsk neilh-adsk moved this to Needs triage in maya-usd Nov 6, 2023
@maya-usd-git-sync
Copy link

Issue synced internally to EMSUSD-810

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Needs triage
Status: Needs triage
Development

No branches or pull requests

1 participant