fix(ui): provide better error message

pull/5746/head
Pavel Zavora 2021-05-03 06:43:59 +02:00
parent 9b96d1b0d0
commit c1b9f703b0
1 changed files with 5 additions and 1 deletions

View File

@ -18,7 +18,11 @@ export const writeLineProtocolAsync = (
await writeLineProtocolAJAX(source, db, data, precision)
dispatch(notify(notifyDataWritten()))
} catch (response) {
dispatch(notify(notifyDataWriteFailed(response.data.error)))
dispatch(
notify(
notifyDataWriteFailed(response.data?.error || response.data?.message)
)
)
throw response
}
}