Skip to content

Commit 25ac6d8

Browse files
committed
Remove stack traces when debug mode is not enabled
1 parent 034919b commit 25ac6d8

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ pip install https://github.com/boto/botocore/archive/v2.zip https://github.com/a
9797

9898
## Change Log
9999

100+
* v0.23.0: Display full stack traces only in `--debug` mode; non-debug runs now show concise error messages, consistent with `awscli` behavior.
100101
* v0.22.0: Use fallback for endpoint detection. Should prevent most cases of `Unable to find LocalStack endpoint for service ...`
101102
* v0.21.1: Introducing semantic versioning and list of services without endpoints
102103
* v0.21: Use placeholder credentials and region only if Boto cannot not find them, fix output streaming for logs tail call

bin/awslocal

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import os
2121
import sys
2222
import subprocess
2323
import re
24+
import traceback
2425
from threading import Thread
2526

2627
from boto3.session import Session
@@ -44,6 +45,8 @@ def get_service():
4445
if not param.startswith('-'):
4546
return param
4647

48+
def is_debug_mode():
49+
return "--debug" in sys.argv
4750

4851
def get_service_endpoint(localstack_host=None):
4952
service = get_service()
@@ -86,7 +89,14 @@ def main():
8689
try:
8790
import awscli.clidriver # noqa: F401
8891
except Exception:
89-
return run_as_separate_process()
92+
try:
93+
return run_as_separate_process()
94+
except Exception as e:
95+
if is_debug_mode():
96+
traceback.print_exc()
97+
else:
98+
print(f"\n{e}")
99+
sys.exit(1)
90100
patch_awscli_libs()
91101
run_in_process()
92102

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
setup(
1818
name='awscli-local',
19-
version='0.22.0',
19+
version='0.23.0',
2020
description=description,
2121
long_description=README,
2222
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)