// Service layer if (!response.ok) { const errorJson = await response.json(); const validated = ApiErrorSchema.parse(errorJson); // 👈 THROWS IF SHAPE WRONG throw validated; } __ __