Skip to content

Guarantee that run() never throws an error#283

Merged
srikrsna-buf merged 1 commit intomainfrom
dflanagan/dont-throw-from-run
Mar 18, 2026
Merged

Guarantee that run() never throws an error#283
srikrsna-buf merged 1 commit intomainfrom
dflanagan/dont-throw-from-run

Conversation

@davidflanagan
Copy link
Contributor

This patch modifies run() to convert any thrown value to a returned CelError, and updates the doc comment to guarantee the function will never throw. It also updates the parse() doc comment to document that that function does throw on parse errors.

Without this patch, callers have to both check the return value of run() and enclose the call in a try/catch block. With the patch it is enough to just check the return value.

@CLAassistant
Copy link

CLAassistant commented Mar 17, 2026

CLA assistant check
All committers have signed the CLA.

This patch modifies run() to convert any thrown value to a
returned CelError, and updates the doc comment to guarantee
the function will never throw. It also updates the parse()
doc comment to document that that function does throw on
parse errors.
@davidflanagan davidflanagan force-pushed the dflanagan/dont-throw-from-run branch from ccbf2a8 to 568b138 Compare March 17, 2026 20:28
@srikrsna-buf srikrsna-buf merged commit f11d057 into main Mar 18, 2026
11 checks passed
@srikrsna-buf srikrsna-buf deleted the dflanagan/dont-throw-from-run branch March 18, 2026 03:50
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.

3 participants