DEV Community

James Moberg
James Moberg

Posted on

Using Try/Catch to Suppress Aborted Download Errors

After upgrading some projects to ColdFusion 2016, we started encountering errors in the logs that were related to client-aborted downloads.

java.io.IOException: An established connection was aborted by the software in your host machine.

After determining that it wasn't a server problem (ColdFusion, IIS, WAF, etc), we added some try/catch logic to suppress the error from showing up in our logs.

Here's some sample CFML code that we've been using. (DISCLAIMER: We don't use or recommend CFContent on projects that use very large files, take a long time to generate or require streaming.)

Latest comments (0)