Add check for error file instead of assuming it exists.