major_exception() working
This commit is contained in:
parent
f75feca345
commit
2270236e42
1 changed files with 3 additions and 4 deletions
|
|
@ -245,8 +245,7 @@ def major_exception():
|
||||||
print(traceback.format_exc())
|
print(traceback.format_exc())
|
||||||
|
|
||||||
# Build report
|
# Build report
|
||||||
## TODO
|
report = generate_debug_report()
|
||||||
report = 'TODO\n'
|
|
||||||
|
|
||||||
# Upload details
|
# Upload details
|
||||||
prompt = 'Upload details to {}?'.format(
|
prompt = 'Upload details to {}?'.format(
|
||||||
|
|
@ -258,7 +257,7 @@ def major_exception():
|
||||||
upload_debug_report(report, reason='CRASH')
|
upload_debug_report(report, reason='CRASH')
|
||||||
except Exception: #pylint: disable=broad-except
|
except Exception: #pylint: disable=broad-except
|
||||||
print_colored(['FAILED'], ['RED'])
|
print_colored(['FAILED'], ['RED'])
|
||||||
LOG.error('Upload failed')
|
LOG.error('Upload failed', exc_info=True)
|
||||||
else:
|
else:
|
||||||
print_success('SUCCESS')
|
print_success('SUCCESS')
|
||||||
LOG.info('Upload successful')
|
LOG.info('Upload successful')
|
||||||
|
|
@ -384,8 +383,8 @@ def strip_colors(string):
|
||||||
|
|
||||||
def upload_debug_report(report, reason='DEBUG'):
|
def upload_debug_report(report, reason='DEBUG'):
|
||||||
"""Upload debug report to CRASH_SERVER as specified in wk.cfg.main."""
|
"""Upload debug report to CRASH_SERVER as specified in wk.cfg.main."""
|
||||||
import requests
|
|
||||||
LOG.info('Uploading debug report to %s', CRASH_SERVER.get('Name', '?'))
|
LOG.info('Uploading debug report to %s', CRASH_SERVER.get('Name', '?'))
|
||||||
|
import requests
|
||||||
|
|
||||||
# Check if the required server details are available
|
# Check if the required server details are available
|
||||||
if not all(CRASH_SERVER.get(key, False) for key in ('Name', 'Url', 'User')):
|
if not all(CRASH_SERVER.get(key, False) for key in ('Name', 'Url', 'User')):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue