Error Handling
Soft limits
A minimum and maximum can be specified for a numerical parameter in the metadata of a funtion, see Writing a new function:

When a user attempts to put a value in that’s out of range, the parameter will turn yellow:

If the user decides to ignore the warning and adds the macro to the queue, there is a pop-up to confirm:

Exceptions and hard limits
You can put a hard limit for any parameter by raising an exception.
Any exception, either intentional or not, will pause the queue, cancel the current macro, and create a pop-up showing the exception that was raised.:
# {"Name":"SomeParameter","Max":10}
def Exception_Function(SomeParameter=5):
if SomeParameter > 10:
raise ValueError(f"{SomeParameter} is too large.")
