Add error message on task not created error

Co-authored-by: Palak Bhojani <palak@influxdata.com>
pull/10616/head
Palak Bhojani 2018-11-15 15:21:41 -08:00
parent b74f61443a
commit 1d5828d05a
2 changed files with 3 additions and 3 deletions

View File

@ -12,9 +12,9 @@ const defaultErrorNotification: NotificationExcludingMessage = {
duration: TEN_SECONDS,
}
export const taskNotCreated = (): Notification => ({
export const taskNotCreated = (additionalMessage: string): Notification => ({
...defaultErrorNotification,
message: 'Failed to create new task',
message: `Failed to create new task: ${additionalMessage}`,
})
export const taskNotFound = (): Notification => ({

View File

@ -251,6 +251,6 @@ export const saveNewScript = () => async (
dispatch(goToTasks())
} catch (e) {
console.error(e)
dispatch(notify(taskNotCreated()))
dispatch(notify(taskNotCreated(e.headers['x-influx-error'])))
}
}