import { ClientResponseError } from 'pocketbase'; export function formatPocketBaseError(e: unknown): string { if (e instanceof ClientResponseError) { const msg = e.response?.message; if (typeof msg === 'string') return msg; if (Array.isArray(msg)) return msg.join(', '); if (e.message) return e.message; } if (e instanceof Error) return e.message; return 'Une erreur est survenue.'; }