diff --git a/README.md b/README.md index 0a275c2..cacf358 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ pip install https://github.com/boto/botocore/archive/v2.zip https://github.com/a ## Change Log +* v0.22.2: Display full stack traces only in `--debug` mode; non-debug runs now show concise error messages, consistent with `awscli` behavior. * v0.22.1: Fix issue with cfn package and cfn deploy with awscli >= 1.41.9 * v0.22.0: Use fallback for endpoint detection. Should prevent most cases of `Unable to find LocalStack endpoint for service ...` * v0.21.1: Introducing semantic versioning and list of services without endpoints diff --git a/bin/awslocal b/bin/awslocal index 8afacb8..0ef01f1 100755 --- a/bin/awslocal +++ b/bin/awslocal @@ -21,6 +21,7 @@ import os import sys import subprocess import re +import traceback PARENT_FOLDER = os.path.realpath(os.path.join(os.path.dirname(__file__), '..')) S3_VIRTUAL_ENDPOINT_HOSTNAME = 's3.localhost.localstack.cloud' @@ -41,6 +42,8 @@ def get_service(): if not param.startswith('-'): return param +def is_debug_mode(): + return "--debug" in sys.argv def get_service_endpoint(localstack_host=None): service = get_service() @@ -83,7 +86,14 @@ def main(): try: import awscli.clidriver # noqa: F401 except Exception: - return run_as_separate_process() + try: + return run_as_separate_process() + except Exception as e: + if is_debug_mode(): + traceback.print_exc() + else: + print(f"\n{e}") + sys.exit(1) patch_awscli_libs() run_in_process() diff --git a/setup.py b/setup.py index b895bb0..bd7e891 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( name='awscli-local', - version='0.22.1', + version='0.22.2', description=description, long_description=README, long_description_content_type='text/markdown',