Skip to content
Snippets Groups Projects
Commit 2d3c4051 authored by Vermaat's avatar Vermaat
Browse files

More useful assertion errors in Mutalyzer monitor

parent 36716161
No related branches found
No related tags found
No related merge requests found
...@@ -19,6 +19,7 @@ import argparse ...@@ -19,6 +19,7 @@ import argparse
import logging import logging
import sys import sys
import time import time
import traceback
import urllib2 import urllib2
from suds import WebFault from suds import WebFault
...@@ -40,6 +41,12 @@ def main(mutalyzer_url): ...@@ -40,6 +41,12 @@ def main(mutalyzer_url):
checks = check_website, check_soap, check_batch checks = check_website, check_soap, check_batch
try: try:
[check(mutalyzer_url) for check in checks] [check(mutalyzer_url) for check in checks]
except AssertionError:
_, _, tb = sys.exc_info()
filename, line, function, text = traceback.extract_tb(tb)[-1]
sys.stderr.write('Failed: %s (line %d)\n' %
(text, line))
sys.exit(1)
except BaseException as e: except BaseException as e:
sys.stderr.write(str(e) + '\n') sys.stderr.write(str(e) + '\n')
sys.exit(1) sys.exit(1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment