Details
-
Type:
Task
-
Status: Done
-
Priority:
Medium
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 3.15.0
-
Component/s: None
-
Labels:None
-
Story Points:1
-
Epic Link:
Description
In some parts of our codebase, we have asserts and ProgramminError's which may happen in release builds. Usually because of weird policy or network input.
I think assert and ProgrammingError should only be reserved for situations which should never happen, not even when a client sends some bad data.
For those situations, we should introduce a new macro, for example:
bool handle_data(const char *data) { assert(data != NULL); // Should never happen if (strlen(data) == 0) { debug_abort_if_reached(); // Abort here, should not happen in tests return false; } // Handle data return true; }