MCPcopy Index your code
hub / github.com/coder/coder / getValidationErrorMessage

Function getValidationErrorMessage

site/src/api/errors.ts:99–105  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

97 * and contains validation messages for different form fields.
98 */
99export const getValidationErrorMessage = (error: unknown): string => {
100 const validationErrors =
101 isApiError(error) && error.response.data.validations
102 ? error.response.data.validations
103 : [];
104 return validationErrors.map((error) => error.detail).join("\n");
105};
106
107export const getErrorDetail = (error: unknown): string | undefined => {
108 if (error instanceof DetailedError) {

Callers 3

FilterFunction · 0.90
errors.test.tsFile · 0.90
getErrorDetailFunction · 0.85

Calls 1

isApiErrorFunction · 0.85

Tested by

no test coverage detected