Can my patcher print errors to the console?

Jesse Morris's icon

I want my patcher to print errors to the console. In my case a patcher uses arguments to choose a configuration from a file (a dict), and if the configuration is not present, I'd like to report an error.

I'm currently hanging some validation logic off a [loadmess #1] which works fine, except it just prints a normal message. I then make it deliberately do something invalid so there's a line of red in the console to draw attention to it, but that feels clumsy.

I can't find any way to do this nicely. I was hoping to see this as an attribute for [print] or as a separate object like [printError] but neither of those seem to exist.

Has anyone found a tidy way to do this?

Ben Bracken's icon

One way is to use the global error() method for js:

function printerror(val) {
    error(val + "\n");
}
Jesse Morris's icon

Thanks, that works great