better error handling in attr context initialisation