🚸 show error on board fetchData

Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
This commit is contained in:
Vinicius Reis
2022-03-21 13:47:59 +01:00
committed by Julius Härtl
parent 6cd8173e98
commit 2e94b8e048
2 changed files with 29 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
import { showError as errorDialog } from '@nextcloud/dialogs'
const showAxiosError = err => {
const response = err?.response || {}
const message = response?.data.message
if (message) {
errorDialog(message)
return
}
errorDialog(err.message)
}
const showError = err => {
// axios error
if (err.response) {
showAxiosError(err)
return
}
errorDialog(err.message)
}
export {
showError,
}