Catch test and source code errors internally so that browsers can be closed and otehr processes are completed after encoutering errors