Wrap viewer.py main in a try block