MCPcopy Create free account
hub / github.com/langgenius/dify / validationError

Function validationError

cli/src/errors/format.test.ts:15–35  ·  view source on GitHub ↗
(overrides: ValidationErrorOverrides = {})

Source from the content-addressed store, hash-verified

13}
14
15function validationError(overrides: ValidationErrorOverrides = {}): HttpClientError {
16 const details
17 = overrides.details
18 ?? [
19 { type: 'int_parsing', loc: ['page'], msg: 'must be >= 1' },
20 { type: 'missing', loc: ['inputs', 'query'], msg: 'field required' },
21 ]
22 return new HttpClientError({
23 code: ErrorCode.Server4xxOther,
24 message: 'Request validation failed',
25 httpStatus: 422,
26 hint: overrides.cliHint,
27 serverError: {
28 code: 'invalid_param',
29 message: 'Request validation failed',
30 status: 422,
31 hint: overrides.serverHint,
32 details,
33 },
34 })
35}
36
37afterEach(() => {
38 setVerbose(false)

Callers 1

format.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected