Skip to content

Commit

Permalink
fix: error cause notation
Browse files Browse the repository at this point in the history
  • Loading branch information
willfarrell committed Jan 3, 2025
1 parent 9764eca commit 96c3020
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ws-router/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 26,12 @@ const wsRouteHandler = (opts = {}) => {
const { routeKey } = event.requestContext ?? {}
if (!routeKey) {
throw createError(400, 'Unknown WebSocket event format', {
cause: { package: '@middy/ws-router', data: routeKey }
cause: { package: '@middy/ws-router', data: { routeKey } }
})
}

// Static
if (Object.hasOwnProperty.call(routesStatic, routeKey)) {
// Static
const handler = routesStatic[routeKey]
return handler(event, context, abort)
}
Expand Down

0 comments on commit 96c3020

Please sign in to comment.