In VelocityCE you could write a script to search the source of the page for a particular word and disconnect.. This keyword would have to be unique to the error pages and not present on any other page..
Below is an example of a script I wrote that searches a demo screen for the ITSmobile and then pops up a message and disconnects after 5 seconds..
In order to view the source, open the page in your browser of choice and right click to view source.. Find your key word in the source of the page and replace my keyword in the example below, "ITSmobile"
Script( Search )
Boolean( bSearch )
Activate( Screen_Update )
bSearch = Web_Search_Source( "ITSmobile", TRUE, TRUE )
If( bSearch )
Message( "Disconnecting in 5 seconds", 5 )
Delay( 5000 )