diff --git a/ui/src/shared/copy/v2/notifications.ts b/ui/src/shared/copy/v2/notifications.ts index 3d292b74d1..33ad2676c8 100644 --- a/ui/src/shared/copy/v2/notifications.ts +++ b/ui/src/shared/copy/v2/notifications.ts @@ -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 => ({ diff --git a/ui/src/tasks/actions/v2/index.ts b/ui/src/tasks/actions/v2/index.ts index 207016519f..fa3fb912a2 100644 --- a/ui/src/tasks/actions/v2/index.ts +++ b/ui/src/tasks/actions/v2/index.ts @@ -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']))) } }