7ab1606
ZhenYi
feat(app): implement multi-page application structure with routing and theme management
7ab1606
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
}
}