fix: exception outside of trial run should be logged and cause nonzero rc

From an earlier stage of the code, there was still an exception catcher that
makes no sense. Remove it.

Change-Id: I8085318c91b06a3e8f7d3f8cfdd15a99650666e2
diff --git a/src/osmo-gsm-tester.py b/src/osmo-gsm-tester.py
index 2d02021..7adb2c5 100755
--- a/src/osmo-gsm-tester.py
+++ b/src/osmo-gsm-tester.py
@@ -70,7 +70,7 @@
 from osmo_gsm_tester import __version__
 from osmo_gsm_tester import trial, suite, log, config
 
-if __name__ == '__main__':
+def main():
     import argparse
 
     parser = argparse.ArgumentParser(epilog=__doc__, formatter_class=argparse.RawTextHelpFormatter)
@@ -166,11 +166,8 @@
     trials = []
     for trial_package in args.trial_package:
         t = trial.Trial(trial_package)
-        try:
-            t.verify()
-            trials.append(t)
-        except:
-            t.log_exn()
+        t.verify()
+        trials.append(t)
 
     trials_passed = []
     trials_failed = []
@@ -212,4 +209,14 @@
                 print('    FAIL:', suite)
         exit(1)
 
+if __name__ == '__main__':
+    try:
+        main()
+    except:
+        # Tell the log to show the exception, then terminate the program with the exception anyway.
+        # Since exceptions within test runs should be caught and evaluated, this is basically about
+        # exceptions during command line parsing and such, so it's appropriate to abort immediately.
+        log.log_exn()
+        raise
+
 # vim: expandtab tabstop=4 shiftwidth=4