mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-21 11:27:18 +00:00
Improve response catch module (#3848)
* add err hanlder for dialog ajax request * add error handler for component ajax request * repair code bug * repair code bug * add handler for page ajax module
This commit is contained in:
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
|
||||
import { Button, Modal, ModalHeader, ModalBody, ModalFooter, Input, Form, FormGroup, Label } from 'reactstrap';
|
||||
import { gettext, orgID } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
|
||||
const propTypes = {
|
||||
toggle: PropTypes.func.isRequired,
|
||||
@@ -33,7 +34,7 @@ class AddRepoDialog extends React.Component {
|
||||
this.props.toggle();
|
||||
this.props.onRepoChanged();
|
||||
}).catch(error => {
|
||||
let errorMsg = gettext(error.response.data.error_msg);
|
||||
let errorMsg = Utils.getErrorMsg(error);
|
||||
this.setState({ errMessage: errorMsg });
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user