MCPcopy Create free account
hub / github.com/andywer/postguard / augmentValidationError

Function augmentValidationError

src/errors.ts:126–143  ·  view source on GitHub ↗
(
  error: Error,
  path: QueryNodePath<any>,
  query: Query
)

Source from the content-addressed store, hash-verified

124}
125
126export function augmentValidationError(
127 error: Error,
128 path: QueryNodePath<any>,
129 query: Query
130): ValidationError {
131 const location =
132 path.type in path.node && "location" in path.node[path.type]
133 ? mapToSourceLocation(query, path.node[path.type].location)
134 : getOverallSourceLocation(query.sourceMap.map(span => span.sourceLocation))
135
136 // tslint:disable-next-line prefer-object-spread
137 return Object.assign(error, {
138 name: "ValidationError",
139 path,
140 location,
141 sourceFile: query.sourceFile
142 })
143}
144
145export function augmentCodeError(
146 error: Error,

Callers 3

assertNoBrokenColumnRefsFunction · 0.90
assertNoBrokenTableRefsFunction · 0.90

Calls 2

mapToSourceLocationFunction · 0.85
getOverallSourceLocationFunction · 0.85

Tested by

no test coverage detected