>This is a general question of philosophy. I've received instruction from various people over the years to go one way or the other. Some have said always code for the unexpected condition. Others have said it's unexpected, should never happen, is in error and should crash. This has been in various languages.
"For database nature loved the world so much that it gave all developers the one and only tool needed to prevent crashes(OTHERWISE), so that whoever useth properly shall not perish from their jobs"
KG 3:16
:)