Skip to content

Commit

Permalink
fix the secret error message for windows profile
Browse files Browse the repository at this point in the history
  • Loading branch information
ghernandez345 committed Jan 6, 2025
1 parent 91f4c64 commit 83f3947
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions frontend/pages/SoftwarePage/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ export const generateSecretErrMsg = (err: unknown) => {
}

if (errorType === "profile") {
return reason
.split(":")[1]
// for profile we can get two different error messages. One contains a colon
// and the other doesn't. We need to handle both cases.
const apiMessages = reason.split(":");
let message = "";
if (apiMessages.length === 1) {
message = apiMessages[0];
} else {
message = apiMessages[1];
}

return message
.replace(/Secret variables?/i, "Variable")
.replace("missing from database", "doesn't exist.");
}
Expand Down

0 comments on commit 83f3947

Please sign in to comment.