Exceptions in .Net plugins

Exceptions in .Net plugins

RFlannery1
Collaborator Collaborator
703 Views
2 Replies
Message 1 of 3

Exceptions in .Net plugins

RFlannery1
Collaborator
Collaborator

We have written a command using the .Net API.  If the command throws an exception, Maya pops up a message box showing the stack trace.  So far, so good.  But if I wrap the command in a try/except block in Python, it still pops up the message box with the stack trace.  Is that the expected behavior?

0 Likes
Accepted solutions (1)
704 Views
2 Replies
Replies (2)
Message 2 of 3

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

Yes, it is. The .NET exceptions are caught by the wrapper(swig). So it will always show a dialog and return corresponding failure MStatus.

 

Yours,

Li

0 Likes
Message 3 of 3

RFlannery1
Collaborator
Collaborator

I was afraid that might be the answer.  Oh, well.  We've got only one plugin that absolutely requires C#.  So it isn't a huge deal.  But if we make more C# plugins in the future, I'll make a bug report.

Thanks for your help.

0 Likes