Catch errors before they hit the repl