Skip to content

Commit f4fc026

Browse files
committed
Much better “Project not found” error
1 parent 32e2059 commit f4fc026

File tree

1 file changed

+11
-1
lines changed
  • packages/cli-v3/src/commands

1 file changed

+11
-1
lines changed

packages/cli-v3/src/commands/dev.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,17 @@ async function startDev(
130130
});
131131

132132
if (!devEnv.success) {
133-
throw new Error(devEnv.error);
133+
if (devEnv.error === "Project not found") {
134+
logger.error(
135+
`Project not found: ${config.config.project}. Ensure you are using the correct project ref and CLI profile (use --profile). Currently using the "${options.profile}" profile, which points to ${authorization.apiUrl}`
136+
);
137+
} else {
138+
logger.error(
139+
`Failed to initialize dev environment: ${devEnv.error}. Using project ref ${config.config.project}`
140+
);
141+
}
142+
143+
process.exit(1);
134144
}
135145

136146
const environmentClient = new CliApiClient(apiUrl, devEnv.data.apiKey);

0 commit comments

Comments
 (0)