Skip to content

Commit 30b177a

Browse files
authored
Replace exception for warning when validating extension bundles range (#264)
1 parent 8fc1345 commit 30b177a

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

azure/durable_functions/__init__.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,15 @@
1313
import json
1414
from pathlib import Path
1515
import sys
16+
import warnings
1617

1718

1819
def validate_extension_bundles():
19-
"""Throw an exception if host.json contains bundle-range V1.
20+
"""Raise a warning if host.json contains bundle-range V1.
2021
21-
Raises
22+
Effects
2223
------
23-
Exception: Exception prompting the user to update to bundles V2
24+
Warning: Warning prompting the user to update to bundles V2
2425
"""
2526
# No need to validate if we're running tests
2627
if "pytest" in sys.modules:
@@ -46,10 +47,13 @@ def validate_extension_bundles():
4647
# We do a best-effort attempt to detect bundles V1
4748
# This is the string hard-coded into the bundles V1 template in VSCode
4849
if version_range == "[1.*, 2.0.0)":
49-
message = "Durable Functions for Python does not support Bundles V1."\
50+
message = "Your application is currently configured to use Extension Bundles V1."\
51+
" Durable Functions for Python works best with Bundles V2,"\
52+
" which provides additional features like Durable Entities, better performance,"\
53+
" and is actively being developed."\
5054
" Please update to Bundles V2 in your `host.json`."\
5155
" You can set extensionBundles version to be: [2.*, 3.0.0)"
52-
raise Exception(message)
56+
warnings.warn(message)
5357

5458

5559
# Validate that users are not in extension bundles V1

0 commit comments

Comments
 (0)