More failure-resistant now.

Now it dies with an error message instead of producing endless log spam.