Move test error catching code before any other script files.