I am perfectly happy with the message 'No such external ID defined' (although it would help a lot if the exception included the actual ID).
Using an assert means that I EXPECT the code NOT to be reached, if all the rest of the code leading to the assert is correct. However, suppose get_object_reference no longer throws an exception, but ignores the error, or any other change in any other part of code means that my assumption that I will have a partner_id on line 15/16 is no longer true: at that moment the assert kicks in.
Hello Stefan,
I am perfectly happy with the message 'No such external ID defined' (although it would help a lot if the exception included the actual ID).
Using an assert means that I EXPECT the code NOT to be reached, if all the rest of the code leading to the assert is correct. However, suppose get_object_ reference no longer throws an exception, but ignores the error, or any other change in any other part of code means that my assumption that I will have a partner_id on line 15/16 is no longer true: at that moment the assert kicks in.