Jump to content

Catching errors from automation tasks


Recommended Posts

Posted

I use an automation task to "Run JavaScript in Chromium browser tab" that might error because AppleScript has to be enabled in those browsers to let that work. I'd like to show a notification that says that, but I don't know how to catch the error coming out of the automation, anyone know?

  • 1 year later...
Posted

I'm wondering the same thing. Can't Alfred tell you what went wrong through a notification or something if the Alfred debugger can show you a red "ERROR" message? Instead, if something doesn't work or breaks, it just… breaks silently.

 

I mean sure, we have the debugger, but @Joost de Valk 's case is valid. 

Posted

The original case in this issue, which is indeed valid, is also highly specific. You wouldn’t really want Alfred’s red debugger text to be shown as a notification because not all errors are relevant. Those message are what’s sent to STDERR. You’ll note from that description that it’s used (emphasis mine) for error messages or diagnostics. That’s a bit weird, right? Couldn’t we have a separate STDDIAG or STDWARN or something? Unfortunately we’re all half a century too late for that now. Computer systems pile on what came before and we need to use what we have.


Plenty of tools use STDERR for informative messages. Have you ever used curl to download something or make a web request? That self-updating progress you see in the terminal is being sent to STDERR. But why? It’s not an error. Indeed, but the alternative would have been to munge it with STDOUT and making a mess of whatever data you’re trying to retrieve when redirecting or piping to another command. Again, we need to make do with what we have and that’s true for all projects.


Now picture if all STDERR messages from all tools and all libraries in all workflows were notifying you left and right of every little thing. Pretty soon we’d all be asking for Alfred to not show those messages. Or worse, ignoring them without paying attention because they’d be irrelevant too often.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...