caron / PyQtForSoftimage

A system for hosting PyQt applications inside Softimage's interface.
29 stars 10 forks source link

Script Errors Not Logging in the script Editor #8

Open Enrique-Caballero opened 11 years ago

Enrique-Caballero commented 11 years ago

Hey Steven, I have been using your plugin for a long time now, almost since the beginning, and I've always had this problem but always assumed that it was due to user error. I have now done a lot of testing and believe that it is not user error. Here it is.

Not all errors will log to the Softimage Script Editor, actually most of them will not.

If there is an error that halts the creation of the PYQT window then it will log that and fail the creation, but if the error is part of a function call that is connected to a button, no error will log.

For example, please go to the pyqt_example.py and edit line 40. Application.LogMessage( self.lineedit.text() )

and add a + 1 to it, to create a Concatanation error. so the line reads like this

Application.LogMessage( self.lineedit.text() + 1)

so this should give us a concatenate error when the button is pressed.

save the script and reload the plugin, reload the window and press the "Log Text" Button. No error will be spit out of the script editor, and the button will simply do nothing.

This problem happens with ANY script problem that is called as a function by a button in the UI. And makes troubleshooting complicated menu's and actions very difficult.

The way I deal with it now is that everytime a function is called by a button, I do a TRY and EXCEPT where it catches ALL exceptions, and then logs then force it to log a message. This helps me diagnose, but it does not help me find the line number with the error.

Anyway if you could please look into this that would be awesome, I love your plugin and rely on it quite heavily

jobenayoun commented 11 years ago

Hey Enrique, three things here you must take care:

This is not related to the plugin but just is common pitfalls you get used to when experienced with python and Qt. hope that help, cheers. -- jon

Enrique-Caballero commented 11 years ago

Thanks for the quick reply Jo, I am not much of a PYQT developer yet, so I guess this shouldn't surprise me. Thank you very much for the information. I will look into improving how I code in order to catch these problems! Thanks again

jobenayoun commented 11 years ago

no worries, really, actually that's really great you took of your time in investigating such problem as I am glad to hear you're using the plugin. Feel free to contact me anytime on my gmail if you have any other questions or even suggestions! =) -- jon