Skip to content

Commit 6004e0d

Browse files
authored
Improve error message thrown when missing permission to deploy to hosting (#7490)
1 parent 65ce56d commit 6004e0d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
- Fixed an issue where `--force` was not respected during `firebase deploy --only storage`. (#7499)
22
- Added support for Customer-managed encryption keys (CMEK) on Firestore databases. (#7479)
3+
- Improved error message thrown when missing permissions to deploy to hosting. (#7190)
34
- Improved default values for 'init dataconnect:sdk'.
4-
- Fix functions:secrets:set - stop erroring in non-interactive flows without force option (#7467)
5+
- Fixed issue where `functions:secrets:set` wrongly errorred in non-interactive flows without force option (#7467)

src/commands/deploy.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,13 @@ export const command = new Command("deploy")
113113
try {
114114
await requireHostingSite(options);
115115
} catch (err: unknown) {
116-
if (err === errNoDefaultSite) {
116+
const isPermissionError =
117+
err instanceof FirebaseError &&
118+
err.original instanceof FirebaseError &&
119+
err.original.status === 403;
120+
if (isPermissionError) {
121+
throw err;
122+
} else if (err === errNoDefaultSite) {
117123
createSite = true;
118124
}
119125
}

0 commit comments

Comments
 (0)