Maya MEL brokennesss, part II

So, is this a documented issue?

[b]global proc errorProc(string $sError) {
waitCursor -state off;
error $sError;
}

if (true) errorProc("It's jacked, man.");
[/b]

Code stops executing at or after the waitCursor command.

More lameness, or is this the way it's supposed to work?

Documentation says that wait cursor states work as stack. Every 'on' call should have matching 'off' call. If you try to set state to 'off' without previously setting it to 'on' you'll cause state stack underflow which in most programming languages throws an exception. If exception is not caught the program will terminate.

global proc errorProc(string $sError) {
catch( waitCursor -state off );
error $sError;
}
errorProc("It's jacked, man.");

Thanks for the explanation.

So, I could actually do this to wipe out any number of waitCursors in the stack, yes?

while (! catchQuiet(waitCursor -state off));

Btw, uncaught exception was probably the reason why script terminated at 'objectType' query in your previous brokenness thread.

When you issue the objectType command for non-existent or multiple same-named objects, the command just throws without printing any errors ( they probably didn't finished implementing the regular error handling functionality )

You can always try to catch exceptions on problematic commands. Catch will return 1 if the statement has thrown an exception.

if( catch( problematicCommand ) ){
// inspect and remedy the situation here
}
// continue normal code flow

yes