Skip to content

Commit

Permalink
fix(ui): fix axios http error message
Browse files Browse the repository at this point in the history
  • Loading branch information
duanyytop committed Jun 15, 2019
1 parent 2dc9be2 commit 11dc671
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ const App = () => {

axiosIns.interceptors.response.use(
response => {
if (response.status === 503) {
const { message } = response.data
appContext.errorMessage = message || appContext.errorMessage
browserHistory.replace('/maintain')
}
return response
},
error => {
if (error.response.status === 503) {
const { message } = error.response.data
appContext.errorMessage = message || appContext.errorMessage
browserHistory.replace('/maintain')
}
console.error(error.toString())
return Promise.reject(error)
},
Expand Down

0 comments on commit 11dc671

Please sign in to comment.