Skip to content

Commit

Permalink
fix: updated error message for attempting to deploy a site with a bad…
Browse files Browse the repository at this point in the history
… auth key

Co-authored-by: Ben Hancock <benhancock859@gmail.com>
  • Loading branch information
dylanspyer and benhancock committed Oct 17, 2024
1 parent 69a7a3b commit abd9eac
Showing 1 changed file with 8 additions and 2 deletions.
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)
} else {
error('Site not found. Please rerun "netlify link"')
}
}
}

0 comments on commit abd9eac

Please sign in to comment.