I haven't seen this discussed yet, so I thought I'd bring it up (for those of you too lazy to read the release notes, and you know who you are!). One of the cool changes to ColdFusion 8.0.1 is the addition of the errorVariable and errorFile attributes to the cfexecute tag. As you can guess, this helps record any errors that may return from your external process. Before this change, there was no way to get the error. Here is a simple example:
<cfexecute name="#variables.bin#" arguments="#realcommand#" variable="result" timeout="99" errorVariable="errorv"/>
<cfif len(errorv)>
Handle the error...
<cfelse>
Handle the good result...
</cfif>
Pretty simple, right? One thing to watch out for is that you cannot use both errorVariable and errorFile. So if you want programatic access to the error and you want to log it - simply use errorVariable and then follow it up with a fileWrite() to save the string.
Archived Comments
SWEET! That's always been an irritation, and I managed to find workarounds, but that will be very handy.
SWEET and SHARP! Missed that one.
Don't miss my discussion from <i>before</i> 8.0.1 (=D) about a cfexecute alternative which flushes to the browser in real time and also gives you access to stdout and stderr. Without much additional effort you could write to stdin (there's a stub for it in this code) to interact with a program.
http://www.bandeblog.com/20...
This should also work for people stuck on CF 6, 7, or 8.0.0.
Thank you! Just saved me hours.
As just an FYI, apparently this wasn't ever documented. I just fixed it in the wiki.
https://learn.adobe.com/wik...