Quick bug fix for lines which were not committed.

pull/222/head
David Pokora 6 years ago
parent 49273ca6ef
commit cc74512184
No known key found for this signature in database
GPG Key ID: 3CED48D1BB21BDD7
  1. 4
      slither/__main__.py

@ -592,7 +592,7 @@ def main_impl(all_detector_classes, all_printer_classes):
except SlitherException as se: except SlitherException as se:
# Output our error accordingly, via JSON or logging. # Output our error accordingly, via JSON or logging.
if stdout_json: if stdout_json:
print(wrap_json_stdout(False, repr(se), [])) print(json.dumps(wrap_json_stdout(False, repr(se), [])))
else: else:
logging.error(red('Error:')) logging.error(red('Error:'))
logging.error(red(se)) logging.error(red(se))
@ -602,7 +602,7 @@ def main_impl(all_detector_classes, all_printer_classes):
except Exception: except Exception:
# Output our error accordingly, via JSON or logging. # Output our error accordingly, via JSON or logging.
if stdout_json: if stdout_json:
print(wrap_json_stdout(False, traceback.format_exc(), [])) print(json.dumps(wrap_json_stdout(False, traceback.format_exc(), [])))
else: else:
logging.error('Error in %s' % args.filename) logging.error('Error in %s' % args.filename)
logging.error(traceback.format_exc()) logging.error(traceback.format_exc())

Loading…
Cancel
Save