/** The server's own sentence when it sent one, rather than "Request failed". */ export const readableError = (failure: unknown): string => { const body = (failure as { body?: { error?: string; detail?: string } })?.body; return body?.error ?? body?.detail ?? (failure as Error)?.message ?? 'Something went wrong.'; };