Show invalid error message once

Fixes #1437