File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed
Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1010"""
1111
1212
13- def _wrap_code_in_try_except (code : str ) -> str :
13+ def _wrap_code_in_try_except (function_name : str , code : str ) -> str :
1414 """ this is necessary because client functions with imports will blow up ALL server functions,
1515 even if they don't use them.
1616 because the server function will try to load all client functions when loading the library
1717 """
1818 prefix = """logger = logging.getLogger("poly")
1919try:
2020 """
21- suffix = """except ImportError as e:
22- logger.debug(e )"""
21+ suffix = f """except ImportError as e:
22+ logger.warning("Failed to import client function ' { function_name } ', function unavailable: " + str(e) )"""
2323
2424 lines = code .split ("\n " )
2525 code = "\n " .join (lines )
@@ -39,6 +39,6 @@ def render_client_function(
3939 return_type_def = return_type_def ,
4040 )
4141
42- code = _wrap_code_in_try_except (code )
42+ code = _wrap_code_in_try_except (function_name , code )
4343
4444 return code + "\n \n " , func_type_defs
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ requires = ["setuptools>=61.2", "wheel"]
33
44[project ]
55name = " polyapi-python"
6- version = " 0.3.8.dev4 "
6+ version = " 0.3.8.dev5 "
77description = " The Python Client for PolyAPI, the IPaaS by Developers for Developers"
88authors = [{ name = " Dan Fellin" , email = " dan@polyapi.io" }]
99dependencies = [
You can’t perform that action at this time.
0 commit comments