MCPcopy Index your code
hub / github.com/payloadcms/payload / parseError

Function parseError

packages/drizzle/src/utilities/parseError.ts:4–14  ·  view source on GitHub ↗
(err: unknown, msg: string)

Source from the content-addressed store, hash-verified

2 * Format error message with hint if available
3 */
4export const parseError = (err: unknown, msg: string): string => {
5 let formattedMsg = `${msg}`
6 if (err instanceof Error) {
7 formattedMsg += ` ${err.message}.`
8 // Check if the error has a hint property
9 if ('hint' in err && typeof err.hint === 'string') {
10 formattedMsg += ` ${err.hint}.`
11 }
12 }
13 return formattedMsg
14}

Callers 4

migrateFreshFunction · 0.85
migrateDownFunction · 0.85
migrateRefreshFunction · 0.85
runMigrationFileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…