Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
1afe452
Structured errors draft - failing tests
AndrewAsseily Oct 6, 2025
c46cf3e
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Oct 22, 2025
6842e4e
Revert "Structured errors draft - failing tests"
AndrewAsseily Oct 24, 2025
3fe5630
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Nov 11, 2025
bcc33fc
Structured Errors implementation Draft 1
AndrewAsseily Nov 14, 2025
829968b
Refactor structured error
AndrewAsseily Nov 17, 2025
00213ca
CLI examples for cloudformation.
elysahall Oct 23, 2025
181b94a
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Nov 17, 2025
6958d85
Remove cli_hide_error_details
AndrewAsseily Nov 17, 2025
9eef83f
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Nov 21, 2025
e678480
Fix start-live-tail tests
kdaily Nov 20, 2025
329d167
Implement --output off format to suppress stdout
AndrewAsseily Nov 25, 2025
5700443
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Nov 25, 2025
073c28d
Add missing off status to output choices
AndrewAsseily Nov 26, 2025
60b04ee
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Dec 1, 2025
b82ef33
Catch and format ClientError exceptions raised during pagination
AndrewAsseily Dec 1, 2025
4b34b62
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Dec 1, 2025
7f511a2
Update test fixtures and documentation for 'off' output format option
AndrewAsseily Dec 2, 2025
b7d7ebe
Update to latest models
aws-sdk-python-automation Dec 2, 2025
614b09a
Update endpoints model
aws-sdk-python-automation Dec 2, 2025
5b0ce61
Bump version to 2.32.8
aws-sdk-python-automation Dec 2, 2025
47b6129
Update to latest models
aws-sdk-python-automation Dec 3, 2025
9f04b48
Bump version to 2.32.9
aws-sdk-python-automation Dec 3, 2025
c7f1a50
Update to latest models
aws-sdk-python-automation Dec 4, 2025
0493e92
Bump version to 2.32.10
aws-sdk-python-automation Dec 4, 2025
ae6987d
Remove TODO for filtering; use --output off for sensitive data instead
AndrewAsseily Dec 4, 2025
dd7974e
Update to latest models
aws-sdk-python-automation Dec 5, 2025
3c5af8d
Bump version to 2.32.11
aws-sdk-python-automation Dec 5, 2025
9db425e
Add changelog entry for structured error output
AndrewAsseily Dec 8, 2025
e62ce3b
[v2] Add monitoring configuration to emr create-cluster (#9892)
justinmae Dec 8, 2025
a31fb33
Update to latest models
aws-sdk-python-automation Dec 8, 2025
79e5322
Update endpoints model
aws-sdk-python-automation Dec 8, 2025
6f0f981
Bump version to 2.32.12
aws-sdk-python-automation Dec 8, 2025
a7e07b7
Merge pull request #9877 from kdaily/startlivetail-stdin-test-fix-v2
kdaily Dec 9, 2025
fa72088
Remove S3 endpoint s3v4 test (#9903)
hssyoo Dec 9, 2025
e6347d1
Update to latest models
aws-sdk-python-automation Dec 9, 2025
7972caf
Update endpoints model
aws-sdk-python-automation Dec 9, 2025
7ceeaa1
Bump version to 2.32.13
aws-sdk-python-automation Dec 9, 2025
2cb1a04
Adds support for expanding host prefix to the BaseRpcV2Serializer cla…
SamRemis Dec 10, 2025
8ac8385
Update model-validation tests to describe violations in custom proper…
aemous Dec 10, 2025
1d0341a
Update to latest models
aws-sdk-python-automation Dec 10, 2025
f9c1256
Bump version to 2.32.14
aws-sdk-python-automation Dec 10, 2025
4989c22
Upgrade bundled Python interpreter to 3.13.11. (#9902)
aemous Dec 10, 2025
b6dddb4
Update to latest models
aws-sdk-python-automation Dec 11, 2025
5e8313d
Update endpoints model
aws-sdk-python-automation Dec 11, 2025
28ab15f
Bump version to 2.32.15
aws-sdk-python-automation Dec 11, 2025
1f517fa
[Documentation] Warning against the use of S3 Global Endpoint (s3.ama…
adev-code Dec 12, 2025
e2598bf
Update to latest models
aws-sdk-python-automation Dec 12, 2025
6d9e747
Update endpoints model
aws-sdk-python-automation Dec 12, 2025
439b186
Bump version to 2.32.16
aws-sdk-python-automation Dec 12, 2025
bc25515
Moves structured error handling into ClientErrorHandler to write erro…
AndrewAsseily Dec 14, 2025
ce86991
Remove cli_error_format from global options docs (config-only variable)
AndrewAsseily Dec 14, 2025
ec56d0e
Fix validates models record_property serialization errors (#9912)
aemous Dec 15, 2025
558c9f6
Update to latest models
aws-sdk-python-automation Dec 15, 2025
41c4e27
Bump version to 2.32.17
aws-sdk-python-automation Dec 15, 2025
6e36a98
[v2] Add GitHub Actions build workflow (#9918)
hssyoo Dec 15, 2025
926c63a
Update to latest models
aws-sdk-python-automation Dec 16, 2025
af6a93c
Update endpoints model
aws-sdk-python-automation Dec 16, 2025
0d754e9
Bump version to 2.32.18
aws-sdk-python-automation Dec 16, 2025
29ee23c
Add structured error output with configurable formats (json, yaml, en…
AndrewAsseily Dec 17, 2025
e003f09
Update changelog entry to reflect new error format settings
AndrewAsseily Dec 17, 2025
4f87cfa
Update validation text and format relevant files
AndrewAsseily Dec 17, 2025
64a79eb
Refactor error handling: simplify logic, add constants
AndrewAsseily Dec 17, 2025
a7548f6
Update documentation to include --cli-error-format global option
AndrewAsseily Dec 17, 2025
3c14ea4
Fix legacy format test to verify modeled fields are not displayed
AndrewAsseily Dec 17, 2025
20923d1
[v2] Fix pr action (#9922)
hssyoo Dec 17, 2025
408c0c6
Fix error handler double construction and improve error format messaging
AndrewAsseily Dec 17, 2025
b6a806a
Update to latest models
aws-sdk-python-automation Dec 17, 2025
dd8b2fc
Update endpoints model
aws-sdk-python-automation Dec 17, 2025
08c42f9
Bump version to 2.32.19
aws-sdk-python-automation Dec 17, 2025
8c77925
Extract service-specific error fields from top-level response
AndrewAsseily Dec 17, 2025
1800d25
Add prefix to CloudTrail S3 digest file listing (#9933)
sasankamouliveleti Dec 18, 2025
8a4c74b
Remove text format from complex value suggestions due to poor array h…
AndrewAsseily Dec 18, 2025
aa19e40
Simplified the format_error method to always use consistent formatting
AndrewAsseily Dec 18, 2025
b4db2ae
Add the new error format to the general options table in config-vars
AndrewAsseily Dec 18, 2025
5ad8a9f
Merge pull request #9851 from aws/v2-sync-pr-9813
kdaily Dec 18, 2025
4232a97
Restore error handler fallback
AndrewAsseily Dec 18, 2025
4f56944
Update to latest models
aws-sdk-python-automation Dec 18, 2025
3943d63
Update endpoints model
aws-sdk-python-automation Dec 18, 2025
1df3abf
Bump version to 2.32.20
aws-sdk-python-automation Dec 18, 2025
d5294d8
ci: Skip new internal build for fork-origin PRs (#9937)
ashovlin Dec 19, 2025
f83e308
Adding new examples for medical-imaging's create-datastore and get-da…
ashovlin Dec 19, 2025
aad20f6
Merge customizations for ARC Region switch
aws-sdk-python-automation Dec 19, 2025
5bc5025
Update to latest models
aws-sdk-python-automation Dec 19, 2025
dd99339
Update endpoints model
aws-sdk-python-automation Dec 19, 2025
5aa7f84
Bump version to 2.32.21
aws-sdk-python-automation Dec 19, 2025
4ed2eac
Introduce ECS Express Text-Only Mode (#9943)
jutyler1 Dec 22, 2025
0c7a1d0
Update to latest models
aws-sdk-python-automation Dec 22, 2025
b7ccb23
Bump version to 2.32.22
aws-sdk-python-automation Dec 22, 2025
4ddf51e
Remove elastictranscoder client following the service deprecation
kdaily Dec 22, 2025
36d2350
[v2] Add case-sensitivity handling to multi-object download operation…
hssyoo Dec 23, 2025
bb51f3b
Update to latest models
aws-sdk-python-automation Dec 23, 2025
46ae82a
Update endpoints model
aws-sdk-python-automation Dec 23, 2025
d6274b5
Bump version to 2.32.23
aws-sdk-python-automation Dec 23, 2025
a9d62b4
Update to latest models
aws-sdk-python-automation Dec 26, 2025
af4ff69
Update endpoints model
aws-sdk-python-automation Dec 26, 2025
12e3109
Bump version to 2.32.24
aws-sdk-python-automation Dec 26, 2025
9a99e6b
Merge pull request #9947 from kdaily/elastictranscoder-removal-v2
kdaily Dec 29, 2025
c460a71
Update to latest models
aws-sdk-python-automation Dec 29, 2025
40a7626
Bump version to 2.32.25
aws-sdk-python-automation Dec 29, 2025
e73a257
refactor: pass parsed_globals at exception handling time
AndrewAsseily Dec 30, 2025
b21394b
Update to latest models
aws-sdk-python-automation Dec 30, 2025
60937ba
Update endpoints model
aws-sdk-python-automation Dec 30, 2025
0adb050
Bump version to 2.32.26
aws-sdk-python-automation Dec 30, 2025
00330f3
Update to latest models
aws-sdk-python-automation Jan 2, 2026
5fd6d51
Bump version to 2.32.27
aws-sdk-python-automation Jan 2, 2026
4d427da
Revert case sensitivity handling feature (#9960)
SamRemis Jan 2, 2026
b04e3df
Bump version to 2.32.28
aws-sdk-python-automation Jan 2, 2026
18b00bd
Update to latest models
aws-sdk-python-automation Jan 5, 2026
12aea15
Bump version to 2.32.29
aws-sdk-python-automation Jan 5, 2026
f1d9604
[v2] ci: scope down GitHub Token permissions (#9965)
ashovlin Jan 6, 2026
9144bc4
Support # in user_agent_appid (#9967)
jonathan343 Jan 6, 2026
55d333b
Merge customizations for Cost Explorer
aws-sdk-python-automation Jan 6, 2026
adcfb9e
Update to latest models
aws-sdk-python-automation Jan 6, 2026
71bc63a
Bump version to 2.32.30
aws-sdk-python-automation Jan 6, 2026
cbfe40a
Fix UnknownArgumentErrorHandler to accept **kwargs
AndrewAsseily Jan 7, 2026
44df686
Update to latest models
aws-sdk-python-automation Jan 7, 2026
832392e
Update endpoints model
aws-sdk-python-automation Jan 7, 2026
ff901d4
Bump version to 2.32.31
aws-sdk-python-automation Jan 7, 2026
afcbf9a
Prevent 'aws login' from updating a profile with existing credentials…
ashovlin Jan 8, 2026
31fbeeb
[v2] Update urllib3 to 2.6.3 (#9971)
hssyoo Jan 9, 2026
bd629ff
[V2] Create update-vpc-link.rst (#9974)
github-actions[bot] Jan 9, 2026
0a415e9
Address code review feedback: simplify namespace handling and remove …
AndrewAsseily Jan 9, 2026
1047303
Merge branch 'v2' into nyandrew/structured-error
AndrewAsseily Jan 9, 2026
c527bd9
Merge branch 'feature/str-std-error' of https://github.com/aws/aws-cl…
AndrewAsseily Jan 9, 2026
36f6e59
Merge branch 'feature/str-std-error' into nyandrew/structured-error
AndrewAsseily Jan 9, 2026
34bb9a7
test_error_handler_receives_parsed_globals_from_clidriver to enable J…
AndrewAsseily Jan 9, 2026
a2cd4a7
Merge branch 'nyandrew/structured-error' of github.com:AndrewAsseily/…
AndrewAsseily Jan 9, 2026
57eec7c
Merge branch 'feature/str-std-error' of https://github.com/aws/aws-cl…
AndrewAsseily Jan 9, 2026
39c4790
Merge branch 'feature/str-std-error' into nyandrew/structured-error
AndrewAsseily Jan 9, 2026
7aaac09
Extend structured error formatting to non-modeled CLI exceptions
AndrewAsseily Jan 13, 2026
90df436
Update changelog entry to reflect CLI errors and not only AWS service…
AndrewAsseily Jan 13, 2026
19e3c1b
Fix cli_error_format documentation wording
AndrewAsseily Jan 13, 2026
8ad7287
Refactor such that the structured format works regardless of session …
AndrewAsseily Jan 13, 2026
0cdaf45
Ran pre-commit and fixed all the remaining failing EMR tests by updat…
AndrewAsseily Jan 13, 2026
4b01307
Consolidated the 3 redundant tests (test_suppresses_simple_response, …
AndrewAsseily Jan 13, 2026
099a3b7
Refactor error handlers to eliminate duplicate _do_handle_exception m…
AndrewAsseily Jan 13, 2026
5ca1c7d
Fixed the failing functional test in tests/functional/s3/test_mv_com…
AndrewAsseily Jan 13, 2026
d935f1d
Use ruamel.yaml in test_structured_error.py
AndrewAsseily Jan 13, 2026
6baf1ff
Use exact string assertions in test_structured_error.py
AndrewAsseily Jan 15, 2026
79aa0dd
Add **kwargs to BaseExceptionHandler.handle_exception
AndrewAsseily Jan 15, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changes/next-release/enhancement-Output-51826.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "enhancement",
"category": "Output",
"description": "Add support for ``--output off`` to suppress all stdout output while preserving stderr for errors and warnings."
}
5 changes: 5 additions & 0 deletions .changes/next-release/feature-Output-59989.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"type": "feature",
"category": "Output",
"description": "Add structured error output with configurable formats. CLI errors now display additional fields in the configured format (legacy, json, yaml, text, table, or enhanced). Configure via ``--cli-error-format``, ``cli_error_format`` config variable, or ``AWS_CLI_ERROR_FORMAT`` environment variable. The new enhanced format is the default. Set ``cli_error_format=legacy`` to preserve the original error format."
}
34 changes: 28 additions & 6 deletions awscli/clidriver.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def create_clidriver(args=None):
session.full_config.get('plugins', {}),
event_hooks=session.get_component('event_emitter'),
)
error_handlers_chain = construct_cli_error_handlers_chain()
error_handlers_chain = construct_cli_error_handlers_chain(session)
driver = CLIDriver(
session=session, error_handler=error_handlers_chain, debug=debug
)
Expand Down Expand Up @@ -246,7 +246,9 @@ def __init__(self, session=None, error_handler=None, debug=False):
self.session = session
self._error_handler = error_handler
if self._error_handler is None:
self._error_handler = construct_cli_error_handlers_chain()
self._error_handler = construct_cli_error_handlers_chain(
self.session
)
if debug:
self._set_logging(debug)
self._update_config_chain()
Expand Down Expand Up @@ -275,6 +277,9 @@ def _update_config_chain(self):
config_store.set_config_provider(
'cli_help_output', self._construct_cli_help_output_chain()
)
config_store.set_config_provider(
'cli_error_format', self._construct_cli_error_format_chain()
)

def _construct_cli_region_chain(self):
providers = [
Expand Down Expand Up @@ -368,6 +373,20 @@ def _construct_cli_auto_prompt_chain(self):
]
return ChainProvider(providers=providers)

def _construct_cli_error_format_chain(self):
providers = [
EnvironmentProvider(
name='AWS_CLI_ERROR_FORMAT',
env=os.environ,
),
ScopedConfigProvider(
config_var_name='cli_error_format',
session=self.session,
),
ConstantProvider(value='enhanced'),
]
return ChainProvider(providers=providers)

@property
def subcommand_table(self):
return self._get_command_table()
Expand Down Expand Up @@ -516,6 +535,7 @@ def main(self, args=None):
command_table = self._get_command_table()
parser = self.create_parser(command_table)
self._add_aliases(command_table, parser)
parsed_args = None
try:
# Because _handle_top_level_args emits events, it's possible
# that exceptions can be raised, which should have the same
Expand All @@ -538,6 +558,7 @@ def main(self, args=None):
e,
stdout=get_stdout_text_writer(),
stderr=get_stderr_text_writer(),
parsed_globals=parsed_args,
)

def _emit_session_event(self, parsed_args):
Expand Down Expand Up @@ -818,7 +839,10 @@ def _parse_potential_subcommand(self, args, subcommand_table):
def __call__(self, args, parsed_globals):
# Once we know we're trying to call a particular operation
# of a service we can go ahead and load the parameters.
event = f'before-building-argument-table-parser.{self._parent_name}.{self._name}'
event = (
f'before-building-argument-table-parser.'
f'{self._parent_name}.{self._name}'
)
self._emit(
event,
argument_table=self.arg_table,
Expand Down Expand Up @@ -1028,9 +1052,7 @@ def _make_client_call(
paginator = client.get_paginator(py_operation_name)
response = paginator.paginate(**parameters)
else:
response = getattr(client, xform_name(operation_name))(
**parameters
)
response = getattr(client, py_operation_name)(**parameters)
return response

def _display_response(self, command_name, response, parsed_globals):
Expand Down
14 changes: 13 additions & 1 deletion awscli/data/cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"text",
"table",
"yaml",
"yaml-stream"
"yaml-stream",
"off"
],
"help": "<p>The formatting style for command output.</p>"
},
Expand Down Expand Up @@ -85,6 +86,17 @@
"no-cli-auto-prompt": {
"action": "store_true",
"help": "<p>Disable automatically prompt for CLI input parameters.</p>"
},
"cli-error-format": {
"choices": [
"legacy",
"json",
"yaml",
"text",
"table",
"enhanced"
],
"help": "<p>The formatting style for error output. By default, errors are displayed in enhanced format.</p>"
}
}
}
Loading