Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: updated error message for attempting to deploy a site with a bad… #6884

Merged
merged 8 commits into from
Oct 25, 2024
10 changes: 8 additions & 2 deletions src/utils/get-site.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ export const getSiteByName = async (api, siteName) => {
}

return siteFoundByName
} catch {
error('Site not found. Please rerun "netlify link"')
} catch (error_) {
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
if (error_.status === 401) {
// @ts-expect-error TS(2571) FIXME: Object is of type 'unknown'.
error(`${error_.message}: could not retrieve site`)
} else {
error('Site not found. Please rerun "netlify link"')
}
}
}
Loading