This commit is contained in:
Bastien COIGNOUX
2026-05-04 08:28:32 +02:00
parent 7f94f83940
commit 695d4e76d0
46 changed files with 13390 additions and 251 deletions

View File

@ -0,0 +1,12 @@
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.';
}