Check for an error?

I have some functions that give an error whenever some conditions are not allowed, but I use a piecewise expression so that they only run when the cause of the error is not present.The issue is that the error still persists when the piecewise says it’s not allowed, so when I try and run it in a ticker none of the actions will run.
is there a way to check if an expression returns an error like “cannot index a number with a number?”

I have an example problem here: Desmos | Graphing Calculator

I think Desmos will always try and evaluate everything, regardless of any conditions. It can handle ‘undefined’ okay (eg. if a=[ ], where f(a) is undefined but not an error, the condition doesn’t break) but errors will always be flagged I think.

If you share with us what you are trying to achieve, we might be able to find an alternative solution that will work for you.

Since count() requires a list, is there a reason you can’t use [a] instead of a alone? I agree with @pirsquared that having your actual graph would be more helpful.

my example is more complicated, and the code is horrific, but it is here:

I am trying to run w and z at the same time, or make one not a viable action when it has an error, but it has an error anyway and wont let either run.

Its probably not possible to use a piecewise equation to check for an error. You can definitely use it to check for an undefined value, like below:
Untitled Graph | Desmos.
I agree with @pirsquared as if we could have the actual graph you were working on it would be very helpful.