diff --git a/mitmproxy2swagger/mitmproxy2swagger.py b/mitmproxy2swagger/mitmproxy2swagger.py index 80968fe..26194de 100755 --- a/mitmproxy2swagger/mitmproxy2swagger.py +++ b/mitmproxy2swagger/mitmproxy2swagger.py @@ -212,6 +212,11 @@ def main(): except FlowReadException as e: print(f"Flow file corrupted: {e}") + traceback.print_exception(*sys.exc_info()) + print(f"{console_util.ANSI_RED}Failed to parse the input file as '{caputre_reader.name()}'. ") + if not args.format: + print(f"It might happen that the input format as incorrectly detected. Please try using '--fromat flow' or '--format har' to specify the input format.{console_util.ANSI_RESET}") + sys.exit(1) except ValueError as e: print(f"ValueError: {e}") # print stack trace