2.2.x layername in errormsg

See #1924 for the rationale of this