-
Notifications
You must be signed in to change notification settings - Fork 3
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: exception handler key events #372
base: main
Are you sure you want to change the base?
Conversation
This PR will trigger a patch release when merged. |
} catch (error) { | ||
// eslint-disable-next-line no-undef | ||
if (error instanceof ClientError) { | ||
return new Response(error.message, { status: 400 }); |
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.
Should rather use the methods from shared-http-utils: https://github.com/adobe/spacecat-shared/blob/main/packages/spacecat-shared-http-utils/src/index.js#L66
|
||
import { Response } from '@adobe/fetch'; | ||
|
||
export default function exceptionHandler(fn) { |
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.
This exception handler could be part of the spacecat-shared-http-utils
package, so that it can be used by other lambdas as well.
No description provided.