Display backend errors on alert save

pull/10616/head
deniz kusefoglu 2018-01-02 16:00:06 -08:00
parent b7aae4fabc
commit fc4d590d52
1 changed files with 4 additions and 4 deletions

View File

@ -66,10 +66,10 @@ class KapacitorRule extends Component {
text: `${rule.name} successfully saved!`,
})
})
.catch(() => {
.catch(e => {
addFlashMessage({
type: 'error',
text: `There was a problem saving ${rule.name}`,
text: `There was a problem saving ${rule.name}: ${e.data.message}`,
})
})
}
@ -117,10 +117,10 @@ class KapacitorRule extends Component {
text: `${rule.name} successfully saved!`,
})
})
.catch(() => {
.catch(e => {
addFlashMessage({
type: 'error',
text: `There was a problem saving ${rule.name}`,
text: `There was a problem saving ${rule.name}: ${e.data.message}`,
})
})
}