feat(search): add NL search error codes and i18n strings
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -135,6 +135,12 @@ public enum ErrorCode {
|
|||||||
/** The merge target is a descendant of the source tag. 400 */
|
/** The merge target is a descendant of the source tag. 400 */
|
||||||
TAG_MERGE_INVALID_TARGET,
|
TAG_MERGE_INVALID_TARGET,
|
||||||
|
|
||||||
|
// --- NL Search ---
|
||||||
|
/** Ollama is unreachable or timed out. 503 */
|
||||||
|
SMART_SEARCH_UNAVAILABLE,
|
||||||
|
/** NL search rate limit exceeded (5 requests per user per minute). 429 */
|
||||||
|
SMART_SEARCH_RATE_LIMITED,
|
||||||
|
|
||||||
// --- Generic ---
|
// --- Generic ---
|
||||||
/** Request validation failed (missing or malformed fields). 400 */
|
/** Request validation failed (missing or malformed fields). 400 */
|
||||||
VALIDATION_ERROR,
|
VALIDATION_ERROR,
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
"error_forbidden": "Sie haben keine Berechtigung für diese Aktion.",
|
"error_forbidden": "Sie haben keine Berechtigung für diese Aktion.",
|
||||||
"error_csrf_token_missing": "Sitzungsfehler. Bitte laden Sie die Seite neu.",
|
"error_csrf_token_missing": "Sitzungsfehler. Bitte laden Sie die Seite neu.",
|
||||||
"error_too_many_login_attempts": "Zu viele Anmeldeversuche. Bitte versuchen Sie es später erneut.",
|
"error_too_many_login_attempts": "Zu viele Anmeldeversuche. Bitte versuchen Sie es später erneut.",
|
||||||
|
"error_smart_search_unavailable": "Die intelligente Suche ist momentan nicht verfügbar. Bitte nutze die normale Suche.",
|
||||||
|
"error_smart_search_rate_limited": "Du hast die Suchfunktion zu häufig genutzt. Bitte warte eine Minute.",
|
||||||
|
"smart_search_keywords_not_applied": "Schlüsselwörter konnten bei dieser Suche nicht berücksichtigt werden.",
|
||||||
"error_validation_error": "Die Eingabe ist ungültig.",
|
"error_validation_error": "Die Eingabe ist ungültig.",
|
||||||
"error_internal_error": "Ein unerwarteter Fehler ist aufgetreten.",
|
"error_internal_error": "Ein unerwarteter Fehler ist aufgetreten.",
|
||||||
"nav_documents": "Dokumente",
|
"nav_documents": "Dokumente",
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
"error_forbidden": "You do not have permission for this action.",
|
"error_forbidden": "You do not have permission for this action.",
|
||||||
"error_csrf_token_missing": "Session error. Please reload the page.",
|
"error_csrf_token_missing": "Session error. Please reload the page.",
|
||||||
"error_too_many_login_attempts": "Too many login attempts. Please try again later.",
|
"error_too_many_login_attempts": "Too many login attempts. Please try again later.",
|
||||||
|
"error_smart_search_unavailable": "The smart search is currently unavailable. Please use the regular search.",
|
||||||
|
"error_smart_search_rate_limited": "You have used the search function too frequently. Please wait a minute.",
|
||||||
|
"smart_search_keywords_not_applied": "Keywords could not be applied to this search.",
|
||||||
"error_validation_error": "The input is invalid.",
|
"error_validation_error": "The input is invalid.",
|
||||||
"error_internal_error": "An unexpected error occurred.",
|
"error_internal_error": "An unexpected error occurred.",
|
||||||
"nav_documents": "Documents",
|
"nav_documents": "Documents",
|
||||||
|
|||||||
@@ -22,6 +22,9 @@
|
|||||||
"error_forbidden": "No tiene permiso para realizar esta acción.",
|
"error_forbidden": "No tiene permiso para realizar esta acción.",
|
||||||
"error_csrf_token_missing": "Error de sesión. Recargue la página.",
|
"error_csrf_token_missing": "Error de sesión. Recargue la página.",
|
||||||
"error_too_many_login_attempts": "Demasiados intentos. Por favor, inténtelo más tarde.",
|
"error_too_many_login_attempts": "Demasiados intentos. Por favor, inténtelo más tarde.",
|
||||||
|
"error_smart_search_unavailable": "La búsqueda inteligente no está disponible en este momento. Por favor, usa la búsqueda normal.",
|
||||||
|
"error_smart_search_rate_limited": "Has utilizado la función de búsqueda demasiadas veces. Por favor, espera un minuto.",
|
||||||
|
"smart_search_keywords_not_applied": "Las palabras clave no pudieron aplicarse a esta búsqueda.",
|
||||||
"error_validation_error": "La entrada no es válida.",
|
"error_validation_error": "La entrada no es válida.",
|
||||||
"error_internal_error": "Se ha producido un error inesperado.",
|
"error_internal_error": "Se ha producido un error inesperado.",
|
||||||
"nav_documents": "Documentos",
|
"nav_documents": "Documentos",
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ export type ErrorCode =
|
|||||||
| 'FORBIDDEN'
|
| 'FORBIDDEN'
|
||||||
| 'CSRF_TOKEN_MISSING'
|
| 'CSRF_TOKEN_MISSING'
|
||||||
| 'TOO_MANY_LOGIN_ATTEMPTS'
|
| 'TOO_MANY_LOGIN_ATTEMPTS'
|
||||||
|
| 'SMART_SEARCH_UNAVAILABLE'
|
||||||
|
| 'SMART_SEARCH_RATE_LIMITED'
|
||||||
| 'VALIDATION_ERROR'
|
| 'VALIDATION_ERROR'
|
||||||
| 'BATCH_TOO_LARGE'
|
| 'BATCH_TOO_LARGE'
|
||||||
| 'BULK_EDIT_TOO_MANY_IDS'
|
| 'BULK_EDIT_TOO_MANY_IDS'
|
||||||
@@ -178,6 +180,10 @@ export function getErrorMessage(code: ErrorCode | string | undefined): string {
|
|||||||
return m.error_csrf_token_missing();
|
return m.error_csrf_token_missing();
|
||||||
case 'TOO_MANY_LOGIN_ATTEMPTS':
|
case 'TOO_MANY_LOGIN_ATTEMPTS':
|
||||||
return m.error_too_many_login_attempts();
|
return m.error_too_many_login_attempts();
|
||||||
|
case 'SMART_SEARCH_UNAVAILABLE':
|
||||||
|
return m.error_smart_search_unavailable();
|
||||||
|
case 'SMART_SEARCH_RATE_LIMITED':
|
||||||
|
return m.error_smart_search_rate_limited();
|
||||||
case 'VALIDATION_ERROR':
|
case 'VALIDATION_ERROR':
|
||||||
return m.error_validation_error();
|
return m.error_validation_error();
|
||||||
case 'BATCH_TOO_LARGE':
|
case 'BATCH_TOO_LARGE':
|
||||||
|
|||||||
Reference in New Issue
Block a user