Errors
Learn how the Argos API reports errors, the shape of an error response, and what each HTTP status code means.
Last updated
Was this helpful?
Was this helpful?
const response = await fetch("https://api.argos-ci.com/v2/project", {
headers: { Authorization: `Bearer ${process.env.ARGOS_TOKEN}` },
});
if (!response.ok) {
const { error, details } = await response.json();
throw new Error(
details?.length
? `${error}: ${details.map((d) => d.message).join(", ")}`
: error,
);
}
const project = await response.json();