mirror of
https://github.com/withastro/astro.git
synced 2025-02-17 22:44:24 -05:00
Handle unauthorized linking
This commit is contained in:
parent
104f071b93
commit
168f3ae389
1 changed files with 6 additions and 0 deletions
|
@ -28,6 +28,12 @@ export async function cmd({ flags }: { config: AstroConfig; flags: Arguments })
|
||||||
body: JSON.stringify(body)
|
body: JSON.stringify(body)
|
||||||
});
|
});
|
||||||
if (!response.ok) {
|
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}`);
|
console.error(`Failed to link project: ${response.status} ${response.statusText}`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue