import type * as t from '@/api/ius/types'; import { HttpError } from '@repo/ui'; import type { WretchError } from 'wretch/types'; type Props = { render: () => Promise; }; export async function withError({ render }: Props) { try { return await render(); } catch (error) { const _error = error as WretchError; const json = _error.json as t.HttpError; return ( ); } }