Skip to content

Commit 17b50c7

Browse files
committed
Show a better error if all vars were blacklisted
1 parent c24af91 commit 17b50c7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

apps/webapp/app/v3/environmentVariables/environmentVariablesRepository.server.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,17 @@ export class EnvironmentVariablesRepository implements Repository {
9090

9191
// Remove `TRIGGER_SECRET_KEY` or `TRIGGER_API_URL`
9292
let values = removeBlacklistedVariables(options.variables);
93+
const removedDuplicates = values.length !== options.variables.length;
9394

9495
//get rid of empty variables
9596
values = values.filter((v) => v.key.trim() !== "" && v.value.trim() !== "");
9697
if (values.length === 0) {
97-
return { success: false as const, error: `You must set at least one value` };
98+
return {
99+
success: false as const,
100+
error: `You must set at least one valid variable.${
101+
removedDuplicates ? " These were ignored because they're blacklisted." : ""
102+
}`,
103+
};
98104
}
99105

100106
//check if any of them exist in an environment we're setting

0 commit comments

Comments
 (0)