Skip to content

Commit

Permalink
Merge pull request #179 from uselagoon/capture_new_env_errors
Browse files Browse the repository at this point in the history
Expanded error handling for New Environment functionality
  • Loading branch information
tobybellwood authored Oct 16, 2023
2 parents cc270cc + 0d102d2 commit 6aa243b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/NewEnvironment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,10 @@ const NewEnvironment = ({
if (error) {
return <div>{error.message}</div>;
}
if (data && !data.deployEnvironmentBranch.includes("Skipped")) {
const errors = ["Skipped", "Error"]
const regex = new RegExp(errors.join("|"), "i");
const err = regex.test(data && data.deployEnvironmentBranch);
if (data && !err) {
refresh().then(setClear).then(closeModal);
}

Expand Down Expand Up @@ -224,7 +227,7 @@ const NewEnvironment = ({
inputBranchName={inputBranchName}
inputProjectName={inputProjectName}
loading={loading}
error={data && data.deployEnvironmentBranch.includes("Skipped")}
error={err}
data={data}
/>

Expand Down

0 comments on commit 6aa243b

Please sign in to comment.