Replaced UserWarnings with proper exceptions
This commit is contained in:
parent
147b9d2035
commit
d722754f12
1 changed files with 3 additions and 4 deletions
|
|
@ -349,7 +349,7 @@ def major_exception():
|
||||||
try:
|
try:
|
||||||
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_error('FAILED')
|
||||||
LOG.error('Upload failed', exc_info=True)
|
LOG.error('Upload failed', exc_info=True)
|
||||||
else:
|
else:
|
||||||
print_success('SUCCESS')
|
print_success('SUCCESS')
|
||||||
|
|
@ -566,7 +566,7 @@ def upload_debug_report(report, compress=True, reason='DEBUG'):
|
||||||
msg = 'Server details missing, aborting upload.'
|
msg = 'Server details missing, aborting upload.'
|
||||||
LOG.error(msg)
|
LOG.error(msg)
|
||||||
print_error(msg)
|
print_error(msg)
|
||||||
raise UserWarning(msg)
|
raise RuntimeError(msg)
|
||||||
|
|
||||||
# Set filename (based on the logging config if possible)
|
# Set filename (based on the logging config if possible)
|
||||||
filename = 'Unknown'
|
filename = 'Unknown'
|
||||||
|
|
@ -597,8 +597,7 @@ def upload_debug_report(report, compress=True, reason='DEBUG'):
|
||||||
|
|
||||||
# Check response
|
# Check response
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
# Using generic exception since we don't care why this failed
|
raise RuntimeError('Failed to upload report')
|
||||||
raise Exception('Failed to upload report')
|
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue