Building robust integrations with Leafy Energy
Even in a demo environment you want to show how to build robust integrations. The conceptual Leafy Energy SDKs therefore include examples of error handling and retry logic.
Types of errors
- 4xx errors (for example invalid parameters, missing permissions).
- 5xx errors (temporary server issues).
- Network errors (timeouts, DNS issues).
Patterns in the SDK
- Automatic retries on selected 5xx and network errors with exponential backoff.
- Clear error classes (for example
LeafyAuthenticationError,LeafyRateLimitError). - Options to configure max retries and timeouts.
In the sample code you can show how your own application adds additional safeguards such as fallback to cache or a “degrade gracefully” mode.
Comments
0 comments
Please sign in to leave a comment.