You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think catch should have run_error_hooks() as well, (maybe I'm confused). We also mentioned that throwing in an error hook would also be bubble up that error, which would be another exception to 1.19 we should probably note in the spec.
I feel less sure about what the behavior should be in finally hooks. I think I could go either way on it, but it should certainly be documented. I suppose you could think of it like try/catch/finally in most languages, which will bubble up an exception if you throw in finally... so that might be a reasonable choice for us.
We might want to close this for now. Both the Java and Node SDKs throw errors from finally and error hooks it seems... which IMHO is fine. Hooks are "user defined" code, and I think throwing it them is reasonable in certain cases, particularly finally and error. Especially in the case of errors, it actually provides a mechanism to force errors to bubble up for debugging purposes, which seems like it could be useful in dev environments.
I think we should write the decision in the spec, regardless of what it is. I can codify the throwing into the spec soon if someone doesn't beat me to it first.
On Fri, May 27, 2022, at 9:01 AM, Todd Baert wrote:
We might want to close this for now. Both the Java and Node SDKs throw errors from `finally` and `error` hooks it seems... which IMHO is fine. Hooks are "user defined" code, and I think throwing it them is reasonable in certain cases, particularly finally and error. Especially in the case of errors, it actually provides a mechanism to force errors to bubble up for debugging purposes, which seems like it could be useful in dev environments.
—
Reply to this email directly, view it on GitHub <#38 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AAAA6DIXU5AI2MSJ3CRXYMLVMDWVHANCNFSM5UJAZDPQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
Activity
toddbaert commentedon Apr 25, 2022
I think
catchshould haverun_error_hooks()as well, (maybe I'm confused). We also mentioned that throwing in an error hook would also be bubble up that error, which would be another exception to 1.19 we should probably note in the spec.I feel less sure about what the behavior should be in
finallyhooks. I think I could go either way on it, but it should certainly be documented. I suppose you could think of it like try/catch/finally in most languages, which will bubble up an exception if you throw infinally... so that might be a reasonable choice for us.See https://github.com/open-feature/sdk-research/blob/main/packages/openfeature-extra/src/lib/hooks/open-telemetry-hook.ts for a real life example of all the hook life-cycle events.
justinabrahms commentedon May 27, 2022
Updated the error_handling to run_error_hooks, which should make it clearer.
toddbaert commentedon May 27, 2022
We might want to close this for now. Both the Java and Node SDKs throw errors from
finallyanderrorhooks it seems... which IMHO is fine. Hooks are "user defined" code, and I think throwing it them is reasonable in certain cases, particularly finally and error. Especially in the case of errors, it actually provides a mechanism to force errors to bubble up for debugging purposes, which seems like it could be useful in dev environments.justinabrahms commentedon May 27, 2022
toddbaert commentedon May 27, 2022
It seems to me this is partially already in the spec (4.3): https://github.com/open-feature/spec/blob/main/specification/flag-evaluation/hooks.md#requirement-43
But we should also say something similar about
errorI guess?chore: resolve remaining dependabot alerts and fix CI link check