Adding some diagnostics to error message setting attribute.