Merge pull request #33490 from overleaf/em-parse-req-errors-2

Reintroduce custom error types in request validation

GitOrigin-RevId: 1985ca04c8fe693fb836b042517d94700343bc46
This commit is contained in:
Eric Mc Sween
2026-05-07 13:32:29 -04:00
committed by Copybot
parent 8c0589df7f
commit 2bb35fafb8
17 changed files with 105 additions and 85 deletions
@@ -54,7 +54,7 @@ describe('parseReq', () => {
}),
})
)
).toThrowError(expect.objectContaining({ name: 'ParamsError' }))
).toThrowError(expect.objectContaining({ name: 'InvalidParamsError' }))
})
it('should throw an error containing issues if the schema is invalid', () => {
@@ -75,9 +75,11 @@ describe('parseReq', () => {
)
).toThrowError(
expect.objectContaining({
issues: expect.arrayContaining([
expect.objectContaining({ path: ['body', 'name'] }),
]),
zodError: expect.objectContaining({
issues: expect.arrayContaining([
expect.objectContaining({ path: ['body', 'name'] }),
]),
}),
})
)
})