Log error to the console and exit when an error is returned instead of hanging silently.