- 
                Notifications
    
You must be signed in to change notification settings  - Fork 11
 
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
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   | 
    
hasAccess should return a boolean (false) in this case and not throw
          
 The problem is that it involves as many changes if not more to change how   | 
    
* main: (22 commits) Revert "fix: updating lorem-ipsum check name in preflight" (#1261) chore(deps): update dependency @adobe/helix-universal to v5.2.3 (#1260) chore(release): 1.177.15 [skip ci] fix(deps): update adobe fixes (#1258) chore(release): 1.177.14 [skip ci] fix: update package-lock.json for new tier client (#1257) fix: Tier client adapt and remove IDPs from AuthZ (#1256) chore(release): 1.177.13 [skip ci] fix(deps): update adobe fixes (#1254) chore(release): 1.177.12 [skip ci] fix(deps): update adobe fixes (#1249) chore(release): 1.177.11 [skip ci] fix(deps): update dependency jsdom to v27 (#1251) chore(release): 1.177.10 [skip ci] fix: dont cache empty result (#1252) chore(release): 1.177.9 [skip ci] fix(deps): update external fixes (#1248) chore(release): 1.177.8 [skip ci] fix(deps): update dependency @adobe/spacecat-shared-rum-api-client to v2.37.4 (#1247) chore(release): 1.177.7 [skip ci] ...
* main: (34 commits) chore(release): 1.182.1 [skip ci] fix(deps): update adobe fixes (#1282) chore(release): 1.182.0 [skip ci] feat: Add tier config option to ASO onboarding command (#1270) fix(deps): update dependency @adobe/spacecat-shared-tier-client to v1.1.0 (#1281) chore(release): 1.181.0 [skip ci] feat: Add key word support for audit command (#1275) chore(release): 1.180.2 [skip ci] fix(deps): update adobe fixes (#1280) chore(release): 1.180.1 [skip ci] fix(deps): update external fixes (#1279) chore(release): 1.180.0 [skip ci] feat: new prerender audit type (#1253) chore(release): 1.179.4 [skip ci] fix(deps): update dependency @adobe/spacecat-shared-data-access to v2.64.0 (#1277) chore(release): 1.179.3 [skip ci] fix(deps): update dependency @adobe/spacecat-shared-data-access to v2.63.0 (#1276) chore(release): 1.179.2 [skip ci] fix(deps): update dependency @adobe/spacecat-shared-utils to v1.50.7 (#1274) chore(release): 1.179.1 [skip ci] ...
| 
           🎉 This PR is included in version 1.182.2 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀  | 
    
Description
Return status code instead of throwing the whole handler
The PR basically wraps the CRUD
customerIntentendpoints in a try catch and returns appropriate status codes instead of allowing thehasAccessfunction 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