Error handling for relationship creation