fix #3406
help #3680 by at least printing the error message before crashing