Add comments to .setComponentAttributes() and improve errors handling

[#84489576]