diff --git a/ui/src/data_explorer/actions/view/write.js b/ui/src/data_explorer/actions/view/write.js index f8289b4864..2dca304ae5 100644 --- a/ui/src/data_explorer/actions/view/write.js +++ b/ui/src/data_explorer/actions/view/write.js @@ -1,17 +1,18 @@ import {writeLineProtocol as writeLineProtocolAJAX} from 'src/data_explorer/apis' -import {errorThrown} from 'shared/actions/errors' import {notify} from 'shared/actions/notifications' -import {notifyDataWritten} from 'shared/copy/notifications' +import { + notifyDataWritten, + notifyDataWriteFailed, +} from 'shared/copy/notifications' export const writeLineProtocolAsync = (source, db, data) => async dispatch => { try { await writeLineProtocolAJAX(source, db, data) dispatch(notify(notifyDataWritten())) } catch (response) { - const errorMessage = `Write failed: ${response.data.error}` - dispatch(errorThrown(response, errorMessage)) + dispatch(notify(notifyDataWriteFailed(response.data.error))) throw response } } diff --git a/ui/src/shared/copy/notifications.js b/ui/src/shared/copy/notifications.js index bb3409555c..ad0f7c66dc 100644 --- a/ui/src/shared/copy/notifications.js +++ b/ui/src/shared/copy/notifications.js @@ -50,6 +50,11 @@ export const notifyDataWritten = () => ({ message: 'Data was written successfully.', }) +export const notifyDataWriteFailed = errorMessage => ({ + ...defaultErrorNotification, + message: `Data write failed: ${errorMessage}`, +}) + export const notifySessionTimedOut = () => ({ type: 'primary', icon: 'triangle',