diff --git a/src/components/ui/bsod/BsodMiddleware.js b/src/components/ui/bsod/BsodMiddleware.js index 6e6726c..2e354a2 100644 --- a/src/components/ui/bsod/BsodMiddleware.js +++ b/src/components/ui/bsod/BsodMiddleware.js @@ -8,12 +8,12 @@ const ABORT_ERR = 20; export default function BsodMiddleware(dispatchBsod: Function, logger: Logger) { return { - catch(resp?: Resp|InternalServerError): Promise { + catch|InternalServerError>(resp?: T): Promise { if (resp && ( (resp instanceof InternalServerError - && InternalServerError.error.code !== ABORT_ERR + && resp.error.code !== ABORT_ERR ) || (resp.originalResponse - && /404|5\d\d/.test(resp.originalResponse.status) + && /404|5\d\d/.test((resp.originalResponse.status: string)) ) )) { dispatchBsod(); diff --git a/src/pages/profile/ProfilePage.js b/src/pages/profile/ProfilePage.js index 3b9a8b7..0ab51be 100644 --- a/src/pages/profile/ProfilePage.js +++ b/src/pages/profile/ProfilePage.js @@ -5,6 +5,7 @@ import PropTypes from 'prop-types'; import { Route, Switch, Redirect } from 'react-router-dom'; import logger from 'services/logger'; +import { browserHistory } from 'services/history'; import { FooterMenu } from 'components/footerMenu'; import Profile from 'components/profile/Profile'; import ChangePasswordPage from 'pages/profile/ChangePasswordPage'; diff --git a/src/services/request/InternalServerError.js b/src/services/request/InternalServerError.js index 950cca2..e262a4c 100644 --- a/src/services/request/InternalServerError.js +++ b/src/services/request/InternalServerError.js @@ -4,6 +4,7 @@ function InternalServerError(error: Error|string|Object, resp?: Response|Object) this.name = 'InternalServerError'; this.message = 'InternalServerError'; + this.error = error; this.stack = (new Error()).stack; if (resp) {