Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: catch exceptions thrown by template interpolation #43

Merged
merged 3 commits into from
Nov 18, 2024

Conversation

cwaldren-ld
Copy link
Contributor

@cwaldren-ld cwaldren-ld commented Nov 13, 2024

This is a first pass at catching exceptions generated by the interpolation process. It wraps each call to interpolate with a try/catch and individually reports an error via the logger.

I know that the exception message in this particular case (in unit test) is pretty useless, but it also seems bad to simply swallow the error with no extra context.

@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-890-invalid-templates branch from 4e32ae0 to 2864ac2 Compare November 13, 2024 00:36
@cwaldren-ld cwaldren-ld marked this pull request as ready for review November 13, 2024 00:36
@cwaldren-ld cwaldren-ld requested a review from a team as a code owner November 13, 2024 00:36
@cwaldren-ld cwaldren-ld marked this pull request as draft November 13, 2024 00:39
@cwaldren-ld cwaldren-ld marked this pull request as ready for review November 15, 2024 00:43
@cwaldren-ld cwaldren-ld force-pushed the cw/sdk-890-invalid-templates branch from de94c03 to 6d0f425 Compare November 15, 2024 22:25
@cwaldren-ld cwaldren-ld merged commit 7a6cfd5 into main Nov 18, 2024
11 checks passed
@cwaldren-ld cwaldren-ld deleted the cw/sdk-890-invalid-templates branch November 18, 2024 23:07
cwaldren-ld pushed a commit that referenced this pull request Nov 18, 2024
🤖 I have created a release *beep* *boop*
---


##
[0.1.1](LaunchDarkly.ServerSdk.Ai-v0.1.0...LaunchDarkly.ServerSdk.Ai-v0.1.1)
(2024-11-18)


### Bug Fixes

* catch exceptions thrown by template interpolation
([#43](#43))
([7a6cfd5](7a6cfd5))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants