index/type-aliases/ErrorCode.md
ErrorCode = typeof
ERROR_CODES[keyof typeofERROR_CODES]
Type for error codes - use for type-safe error code handling
error codes
Example
function handleError(code: ErrorCode) {
switch (code) {
case ERROR_CODES.REQUIRED:
return 'This field is required';
case ERROR_CODES.INVALID_FORMAT:
return 'Invalid format';
// ... other cases
}
}