MCPcopy
hub / github.com/redwoodjs/graphql / validateWith

Function validateWith

packages/api/src/validations/validations.ts:627–634  ·  view source on GitHub ↗
(func: () => Promise<any>)

Source from the content-addressed store, hash-verified

625
626// Async version is the default
627export const validateWith = async (func: () => Promise<any>) => {
628 try {
629 await func()
630 } catch (e) {
631 const message = (e as Error).message || (e as string)
632 throw new ValidationErrors.ServiceValidationError(message)
633 }
634}
635
636// Wraps `callback` in a transaction to guarantee that `field` is not found in
637// the database and that the `callback` is executed before someone else gets a

Callers 2

default.input.jsFile · 0.85

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected