Skip to content

Commit

Permalink
- Error handling message will now only print if an error is generate…
Browse files Browse the repository at this point in the history
…d and handled
  • Loading branch information
Michaellh0079 committed Jul 18, 2024
1 parent 2f0fdf5 commit 0987d9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pylot/plugins/cumulus_api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ def main(action, target, output=None, **kwargs):
def error_handling(results, api_function, **kwargs):
ret = ''
if results.get('error', '') == 'Bad Request':
if 'Member must have length less than or equal to 8192' in results.get('message', ''):
print('Handling 8192 character limit error...')
error_message = results.get('message', '')
if 'Member must have length less than or equal to 8192' in error_message:
print(f'Handling error: {error_message}')
cli = boto3.client('s3')
stack_prefix = os.getenv('STACK_PREFIX')
if not stack_prefix:
Expand Down Expand Up @@ -207,5 +208,4 @@ def error_handling(results, api_function, **kwargs):
ec.put_targets(Rule=rule_name, Targets=res.get('Targets'))
else:
ret = results
print('Error handling complete')
return ret

0 comments on commit 0987d9e

Please sign in to comment.