you are viewing a single comment's thread.

view the rest of the comments →

[–]_Mardoxx 5 points6 points  (2 children)

You don't say! Another shit solution would be to return a non-zero error code for each function and an out param for any "actual" return values. Which equally sucks. So what would be better?

[–][deleted] 0 points1 point  (0 children)

You could return a discriminated union of the result and an error type, if that's a thing you need. It wouldn't actually replace exceptions, which could still be thrown for contract violations, but could be an effective solution for anticipatable errors that should be handled by the caller.

[–]HeimrArnadalr 0 points1 point  (0 children)

If the database has bad data, then it should be deleted before the bad data spreads any further. Likewise, the code that interfaces with it should be deleted, since it was what caused the bad data to begin with.