import { isMessageKey, t } from '@/shared/i18n' export function errorMessage(code: string): string | undefined { const key = `error.${code}` return isMessageKey(key) ? t(key) : undefined } export class AuthError extends Error { code: string retryAfter: number constructor(code: string, message: string, retryAfter = 0) { super(message) this.name = 'AuthError' this.code = code this.retryAfter = retryAfter } }