Profiles: more mature error handling

Change-Id: Ib60b2cd37542d933f77a6cfff886b4ba0e3b9d1e