![libraries dev error handling](../figures/libraries-dev-error-handling.png)
Data Source Connector Best Practices
-
Error handling with reasonable error messages propagated by the Fail component.
-
Alternatively, you can call the
raiseError(string message)
function directly from the CTL2 code. Make sure to use a descriptive error message.
![libraries dev error handling](../figures/libraries-dev-error-handling.png)
-
Use secure graph parameters for sensitive input parameters such as passwords or tokens. Be aware that secure parameters are encrypted with your CloverDX Server master password and won’t work on another instance with a different master password.
![libraries dev secure params](../figures/libraries-dev-secure-params.png)
-
Keep subgraphs small and focused on accomplishing a single task. Use several layers of subgraphs if needed (e.g. lower level subgraphs for core API calls, higher level subgraphs already specialized with business logic to simplify usage and eliminate complex or excessive configuration options). Don’t try to create connectors that would be too universal - create several simple ones instead. The CloverDX Data Catalog helps end users navigate among options to find the one most suited to their needs.
-
Consult with business users about their requirements and offer custom solutions for their business cases.
-
Prefer enums for parameters when possible. This helps users avoid input errors.
-
Design the Data Source Connector with Wrangler’s join limitations in mind. Prepare data that meets the needs of Business users.
-
For entities such as Customers, Contacts, Invoices, etc., include relevant references in the Data Source Connector.
-
For example, for an Invoice entity, join Customer and Contact information to provide more context in your Data Source Connector.
-
-
Use parameters for the Data Source Connector if there are filters (e.g., valid/invalid records). This allows business users to easily adjust the data set returned by the connector.
-
Test thoroughly before publishing for users.