by bdangubic · 11mo ago · 0 comments
if (cosmic_ray) {
do_not_flip_bits()
} else {
flip_away()
} try {
do_action()
} catch (BitFlipError e) {
logger.critical("Shouldn't get here")
}
Ask-for-forgiveness as an error detection pattern avoids these kinds of errors entirely. int cosmic_ray = 0
if (bool(cosmic_ray)) {
throw cosmicRayException()
}