MCPcopy Index your code
hub / github.com/codebymitch/TitanBot / resolveErrorCode

Function resolveErrorCode

src/utils/errorRegistry.js:114–131  ·  view source on GitHub ↗
({ error, errorType = 'unknown', context = {} } = {})

Source from the content-addressed store, hash-verified

112}
113
114export function resolveErrorCode({ error, errorType = 'unknown', context = {} } = {}) {
115 const contextCode = normalizeErrorCode(context?.errorCode);
116 if (contextCode) {
117 return contextCode;
118 }
119
120 const nestedContextCode = normalizeErrorCode(error?.context?.errorCode);
121 if (nestedContextCode) {
122 return nestedContextCode;
123 }
124
125 const code = normalizeErrorCode(error?.code);
126 if (code) {
127 return code;
128 }
129
130 return getDefaultErrorCodeByType(errorType);
131}
132
133export { ErrorCodes, ErrorCodeRegistry, TypeToErrorCode };

Callers 2

ensureTypedServiceErrorFunction · 0.90
buildErrorLogDataFunction · 0.90

Calls 2

normalizeErrorCodeFunction · 0.85

Tested by

no test coverage detected