Use a more strict content pattern in error sweep

(cherry picked from commit 8c007d9ff9180ec1e3f5ab1f8e8e8751c7e7ede0)