Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ui): updated duplicate check error message #17404

Merged
merged 3 commits into from
Mar 24, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
1. [17363](https://github.com/influxdata/influxdb/pull/17363): Fixed telegraf configuration bugs where system buckets were appearing in the buckets dropdown
1. [17391](https://github.com/influxdata/influxdb/pull/17391): Fixed threshold check bug where checks could not be created when a field had a space in the name
1. [17384](https://github.com/influxdata/influxdb/pull/17384): Reuse slices built by iterator to reduce allocations
1. [17404](https://github.com/influxdata/influxdb/pull/17404): Updated duplicate check error message to be more explicit and actionable

### UI Improvements

Expand Down
7 changes: 7 additions & 0 deletions ui/src/checks/actions/thunks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ export const createCheckFromTimeMachine = () => async (
const check = builderToPostCheck(state)
const resp = await api.postCheck({data: check})
if (resp.status !== 201) {
if (resp.data.code.includes('conflict')) {
throw new Error(
`A check named ${
check.name
} already exists. Please rename the check before saving`
)
}
throw new Error(resp.data.message)
}

Expand Down