File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
lib/dl_api_lib/dl_api_lib/app/control_api/resources Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 1414 get_connection_form_factory_cls ,
1515)
1616from dl_api_lib .enums import BI_TYPE_AGGREGATIONS
17- from dl_api_lib .exc import UnsupportedForEntityType
17+ from dl_api_lib .exc import (
18+ BadConnectionType ,
19+ UnsupportedForEntityType ,
20+ )
1821from dl_api_lib .public .entity_usage_checker import PublicEnvEntityUsageChecker
1922from dl_api_lib .schemas .main import BadRequestResponseSchema
2023from dl_constants .enums import (
@@ -185,10 +188,9 @@ class ConnectorForm(BIResource):
185188 },
186189 )
187190 def get (self , conn_type : str , form_mode : str ) -> dict :
188- try :
189- ct = ConnectionType (conn_type )
190- except ValueError :
191- raise UnsupportedForEntityType (f"Unknown connector type: { conn_type } " ) from None
191+ if not conn_type or conn_type not in ConnectionType :
192+ raise BadConnectionType (f"Not a valid connection type for this environment: { conn_type } " )
193+ ct = ConnectionType (conn_type )
192194
193195 try :
194196 mode = ConnectionFormMode (form_mode )
You can’t perform that action at this time.
0 commit comments