Skip to content

Commit 28ff02c

Browse files
authored
Changing the 'ModuleNotFound' error message. (#997)
1 parent 91f18ff commit 28ff02c

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

azure_functions_worker/loader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def uninstall() -> None:
4646

4747
@attach_message_to_exception(
4848
expt_type=ImportError,
49-
message=f'Troubleshooting Guide: {MODULE_NOT_FOUND_TS_URL}'
49+
message=f'Please check the requirements.txt file for the missing module. '
50+
f'For more info, please refer the troubleshooting'
51+
f' guide: {MODULE_NOT_FOUND_TS_URL} '
5052
)
5153
def load_function(name: str, directory: str, script_file: str,
5254
entry_point: typing.Optional[str]):

tests/unittests/test_http_functions.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,9 @@ def check_log_import_module_troubleshooting_url(self,
321321
host_out: typing.List[str]):
322322
self.assertIn("Exception: ModuleNotFoundError: "
323323
"No module named 'does_not_exist'. "
324-
"Troubleshooting Guide: "
324+
"Please check the requirements.txt file for the "
325+
"missing module. For more info, please refer the "
326+
"troubleshooting guide: "
325327
"https://aka.ms/functions-modulenotfound", host_out)
326328

327329
@pytest.mark.flaky(reruns=3)

tests/unittests/test_loader.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,9 @@ def test_loader_outside_main_package_should_be_loaded_from_package(self):
128128
def check_log_loader_module_not_found(self, host_out):
129129
self.assertIn("Exception: ModuleNotFoundError: "
130130
"No module named 'notfound'. "
131-
"Troubleshooting Guide: "
131+
"Please check the requirements.txt file for the "
132+
"missing module. For more info, please refer the "
133+
"troubleshooting guide: "
132134
"https://aka.ms/functions-modulenotfound", host_out)
133135

134136

0 commit comments

Comments
 (0)