Skip to content

Commit 967862a

Browse files
Sean Smithsean-smith
authored andcommitted
Fix Error Handling for list
Added in a ClientError handler for the list call. This makes it uniform with the rest of the code base on how we handle errors. Signed-off-by: Sean Smith <[email protected]>
1 parent 522684f commit 967862a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cli/cfncluster/cfncluster.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,9 @@ def list(args):
221221
for stack in stacks:
222222
if stack.get('StackName').startswith('cfncluster-'):
223223
logger.info('%s' % (stack.get('StackName')[11:]))
224+
except ClientError as e:
225+
logger.critical(e.response.get('Error').get('Message'))
226+
sys.exit(1)
224227
except KeyboardInterrupt:
225228
logger.info('Exiting...')
226229
sys.exit(0)

0 commit comments

Comments
 (0)