Detect internal error (like too many error messages)

Signed-off-by: Michal Čihař <michal@cihar.com>