Skip to content

Commit

Permalink
fix error response
Browse files Browse the repository at this point in the history
  • Loading branch information
mattkime committed Jun 17, 2023
1 parent 9723667 commit bc6de5d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const registerFieldPreviewRoute = ({ router }: RouteDependencies): void =
schema.arrayOf(valueSchema),
]),
error: schema.maybe(schema.object({}, { unknowns: 'allow' })),
status: schema.maybe(schema.number()),
}),
},
},
Expand Down Expand Up @@ -81,7 +82,7 @@ export const registerFieldPreviewRoute = ({ router }: RouteDependencies): void =
// Return 200 with error object
const handleCustomError = () => {
return res.ok({
body: { values: [], error: error.body },
body: { values: [], error: error.body?.error, status: error.statusCode },
});
};

Expand Down

0 comments on commit bc6de5d

Please sign in to comment.