diff --git a/packages/db/src/core/cli/commands/link/index.ts b/packages/db/src/core/cli/commands/link/index.ts index f4b3a45911..d7775e00e6 100644 --- a/packages/db/src/core/cli/commands/link/index.ts +++ b/packages/db/src/core/cli/commands/link/index.ts @@ -28,6 +28,12 @@ export async function cmd({ flags }: { config: AstroConfig; flags: Arguments }) body: JSON.stringify(body) }); if (!response.ok) { + // Unauthorized + if(response.status === 401) { + console.error('Unauthorized. Are you logged-in? Run `astro db login` to authenticate and then try linking again.'); + process.exit(1); + } + console.error(`Failed to link project: ${response.status} ${response.statusText}`); process.exit(1); }