Fix error handling in dashboard actions and add errorThrown to dashboard page.
parent
116c2e3c23
commit
b53c359a54
|
@ -137,9 +137,8 @@ export const getDashboardsAsync = () => async dispatch => {
|
|||
const {data: {dashboards}} = await getDashboardsAJAX()
|
||||
dispatch(loadDashboards(dashboards))
|
||||
} catch (error) {
|
||||
dispatch(errorThrown(error))
|
||||
console.error(error)
|
||||
throw error
|
||||
dispatch(errorThrown(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -149,7 +148,7 @@ export const putDashboard = dashboard => async dispatch => {
|
|||
dispatch(updateDashboard(data))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
// dispatch(errorThrown(error))
|
||||
dispatch(errorThrown(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -189,9 +188,8 @@ export const addDashboardCellAsync = dashboard => async dispatch => {
|
|||
)
|
||||
dispatch(addDashboardCell(dashboard, data))
|
||||
} catch (error) {
|
||||
dispatch(errorThrown(error))
|
||||
console.error(error)
|
||||
throw error
|
||||
dispatch(errorThrown(error))
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -200,7 +198,7 @@ export const deleteDashboardCellAsync = cell => async dispatch => {
|
|||
await deleteDashboardCellAJAX(cell)
|
||||
dispatch(deleteDashboardCell(cell))
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
dispatch(errorThrown(error))
|
||||
throw error
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,6 +11,8 @@ import Dashboard from 'src/dashboards/components/Dashboard'
|
|||
import TemplateVariableManager
|
||||
from 'src/dashboards/components/TemplateVariableManager'
|
||||
|
||||
import {errorThrown as errorThrownAction} from 'shared/actions/errors'
|
||||
|
||||
import * as dashboardActionCreators from 'src/dashboards/actions'
|
||||
|
||||
import {setAutoRefresh} from 'shared/actions/app'
|
||||
|
@ -196,7 +198,7 @@ class DashboardPage extends Component {
|
|||
|
||||
handleRunQueryFailure(error) {
|
||||
console.error(error)
|
||||
// this.props.errorThrown(error)
|
||||
this.props.errorThrown(error)
|
||||
}
|
||||
|
||||
getActiveDashboard() {
|
||||
|
@ -383,7 +385,7 @@ const mapDispatchToProps = dispatch => ({
|
|||
handleChooseAutoRefresh: bindActionCreators(setAutoRefresh, dispatch),
|
||||
handleClickPresentationButton: presentationButtonDispatcher(dispatch),
|
||||
dashboardActions: bindActionCreators(dashboardActionCreators, dispatch),
|
||||
// errorThrown: bindActionCreators(errorThrownAction, dispatch),
|
||||
errorThrown: bindActionCreators(errorThrownAction, dispatch),
|
||||
})
|
||||
|
||||
export default connect(mapStateToProps, mapDispatchToProps)(DashboardPage)
|
||||
|
|
Loading…
Reference in New Issue