Skip to content

Commit d4f0cb8

Browse files
committed
return None
1 parent 1fbfcd2 commit d4f0cb8

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

azure/functions/decorators/durable_functions.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def get_durable_package():
1717
If both the legacy and current packages are installed,
1818
we log a warning and prefer the current package.
1919
20-
If neither package is installed, we raise an exception.
20+
If neither package is installed, we return None.
2121
"""
2222
_logger.info("Attempting to import Durable Functions package.")
2323
using_legacy = False
@@ -50,12 +50,7 @@ def get_durable_package():
5050
"The `durabletask-azurefunctions` package will be used.")
5151

5252
if not using_durable_task and not using_legacy:
53-
error_message = \
54-
"Attempted to use a Durable Functions decorator, " \
55-
"but the `durabletask-azurefunctions` SDK package could not be " \
56-
"found. Please install `durabletask-azurefunctions` to use " \
57-
"Durable Functions."
58-
raise Exception(error_message)
53+
return None
5954

6055
df = durable_functions
6156

azure/functions/decorators/function_app.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,16 @@ def _get_durable_blueprint(self):
351351
"""
352352
_logger.info("Getting Durable Functions blueprint.")
353353
df = get_durable_package()
354-
df_bp = df.Blueprint()
355-
return df_bp
354+
if df:
355+
df_bp = df.Blueprint()
356+
return df_bp
357+
else:
358+
error_message = \
359+
"Attempted to use a Durable Functions decorator, " \
360+
"but the `durabletask-azurefunctions` SDK package could not be " \
361+
"found. Please install `durabletask-azurefunctions` to use " \
362+
"Durable Functions."
363+
raise Exception(error_message)
356364

357365

358366
@property

0 commit comments

Comments
 (0)