Code should try to fail safely as much as possible. Meaning, no harm to the system or its data should be expected for situations where you can prevent so.