-
Notifications
You must be signed in to change notification settings - Fork 9
fix: catch error within customerIntent endpoints #1226
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
base: main
Are you sure you want to change the base?
Conversation
Return status code instead of throwing the whole handler
This PR will trigger a patch release when merged. |
@JayKid |
const { llmoConfig } = await getSiteAndValidateLlmo(context); | ||
return ok(llmoConfig.customerIntent || []); | ||
try { | ||
const { llmoConfig } = await getSiteAndValidateLlmo(context); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handle it in getSiteAndValidateLlmo method itself rather everyplace
shouldn't be the responsibility of the endpoint to choose what to return to the client, instead of doing it inside of a access helper? or did I misunderstand what you mean by:
|
I was just saying that changes are wrapping |
Description
Return status code instead of throwing the whole handler
The PR basically wraps the CRUD
customerIntent
endpoints in a try catch and returns appropriate status codes instead of allowing thehasAccess
function throwing an error to crash the handler.Please ensure your pull request adheres to the following guidelines:
describe here the problem you're solving.
Related Issues