Coders at Work on finding and preventing bugs (2015)
benkuhn.net
benkuhn.net
Anywhere where you're tempted to crash because it's not possible, I add
recover debug_string debug_values return_value
Recover prints a stack trace, notifies Rollbar, and then continues with the return value. As a result, we see whatever is going wrong with the code, but the program doesn't crash on users. And since we're using OCaml (strongly typed), we end up having decent guarantees of safety.Works pretty well for us.
Are they any noteworthy differences?
I wonder if it's still useful in combination with async/await.