diff --git a/slither/__main__.py b/slither/__main__.py index 0687293a5..cc15e9c60 100644 --- a/slither/__main__.py +++ b/slither/__main__.py @@ -651,15 +651,18 @@ def main_impl(all_detector_classes, all_printer_classes): except SlitherException as se: output_error = str(se) + traceback.print_exc() logging.error(red('Error:')) logging.error(red(output_error)) logging.error('Please report an issue to https://github.com/crytic/slither/issues') except Exception: output_error = traceback.format_exc() + logging.error(traceback.print_exc()) logging.error('Error in %s' % args.filename) logging.error(output_error) + # If we are outputting JSON, capture the redirected output and disable the redirect to output the final JSON. if outputting_json: if 'console' in args.json_types: diff --git a/slither/solc_parsing/declarations/contract.py b/slither/solc_parsing/declarations/contract.py index e4cfb9cdf..896150476 100644 --- a/slither/solc_parsing/declarations/contract.py +++ b/slither/solc_parsing/declarations/contract.py @@ -289,7 +289,7 @@ class ContractSolc04(Contract): try: for function in self.functions: function.analyze_content() - except (VariableNotFound, KeyError) as e: + except (VariableNotFound, KeyError, ParsingError) as e: self.log_incorrect_parsing(f'Missing function {e}') return