How can I know what exceptions to lookout for in a boto3 API call ?
try:
ec2_client = boto3.client('ec2')
except Exception as e:
print(f"Error: {e}")
return JsonResponse({'message': 'An error occurred'}, status=500)
except Boto3Exception as e: # looking for something like Boto3Exception
print(f"Error: {e}")
return JsonResponse({'message': 'A boto3 error occurred'}, status=500)