re #7910 improve error handling