Include layer name in error message from renderer (#1924)

This is the 2.1.x version of #1936, being discussed in #1924

I think this one, contrary to the 2.2.x version, handles all renderers