Error Handling
Calls return { data, error, response } rather than throwing on API errors:
const { data, error, response } = await ch.getCompanyProfile({ path: { company_number: "00000000" },});
if (error) { console.error(response.status, error);}Throwing variants
Section titled “Throwing variants”Pass throwOnError: true on a call to get a throwing variant with non-optional data:
const { data } = await ch.getCompanyProfile({ path: { company_number: "00445790" }, throwOnError: true,});