Merge pull request #1812 from influxdata/update/news_feed_errors-1628

Improve error message on JSON Feed GET fail
pull/1821/head
Jared Scheib 2017-08-01 16:30:06 -07:00 committed by GitHub
commit 87a1a19f22
2 changed files with 6 additions and 11 deletions

View File

@ -7,6 +7,7 @@
### UI Improvements
1. [#1796](https://github.com/influxdata/chronograf/pull/1796): Add spinner to indicate data is being written
1. [#1800](https://github.com/influxdata/chronograf/pull/1800): Embiggen text area for line protocol manual entry in Data Explorer's Write Data overlay
1. [#1812](https://github.com/influxdata/chronograf/pull/1812): Improve error message when request for Status Page News Feed fails
## v1.3.5.0 [2017-07-27]
### Bug Fixes

View File

@ -7,8 +7,6 @@ import {errorThrown} from 'shared/actions/errors'
import * as actionTypes from 'src/status/constants/actionTypes'
import {HTTP_NOT_FOUND} from 'shared/constants'
const fetchJSONFeedRequested = () => ({
type: actionTypes.FETCH_JSON_FEED_REQUESTED,
})
@ -45,15 +43,11 @@ export const fetchJSONFeedAsync = url => async dispatch => {
} catch (error) {
console.error(error)
dispatch(fetchJSONFeedFailed())
if (error.status === HTTP_NOT_FOUND) {
dispatch(
errorThrown(
error,
`Failed to fetch News Feed. JSON Feed at '${url}' returned 404 (Not Found)`
)
dispatch(
errorThrown(
error,
`Failed to fetch JSON Feed for News Feed from '${url}'`
)
} else {
dispatch(errorThrown(error, 'Failed to fetch NewsFeed'))
}
)
}
}