Add error message on task not created error
Co-authored-by: Palak Bhojani <palak@influxdata.com>pull/10616/head
parent
b74f61443a
commit
1d5828d05a
|
@ -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 => ({
|
||||
|
|
|
@ -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'])))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue