Skip to content

armgit / avibe

Public Imported from GitHub
0

Make your computer a home for your AI partner. Avibe is the local-first Agent OS: Vibey, its built-in AI partner, works out of the box, and Claude Code, Codex & OpenCode run unchanged beside it — reach them from your browser, phone, or any chat app.

508 B
Raw Blame
import type { TFunction } from 'i18next';
import { errorMessage } from './errorMessage';

/** Use the same stable-code catalog as ApiContext's toast fallback. */
export function vaultErrorMessage(t: TFunction, error: unknown, fallback: string): string {
  const message = errorMessage(error) ?? fallback;
  const code = typeof error === 'object' && error !== null && 'code' in error ? error.code : null;
  return typeof code === 'string' && code ? t(`errors.${code}`, { defaultValue: message }) : message;
}