mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-07 18:03:48 +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:
@@ -4,6 +4,7 @@ import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
|
||||
import Select from 'react-select/lib/Creatable';
|
||||
import { gettext } from '../../utils/constants';
|
||||
import { seafileAPI } from '../../utils/seafile-api';
|
||||
import { Utils } from '../../utils/utils';
|
||||
import toaster from '../toast';
|
||||
|
||||
const propTypes = {
|
||||
@@ -46,12 +47,7 @@ class CleanTrash extends React.Component {
|
||||
this.props.refreshTrash();
|
||||
this.props.toggleDialog();
|
||||
}).catch((error) => {
|
||||
let errorMsg = '';
|
||||
if (error.response) {
|
||||
errorMsg = error.response.data.error_msg || gettext('Error');
|
||||
} else {
|
||||
errorMsg = gettext('Please check the network.');
|
||||
}
|
||||
let errorMsg = Utils.getErrorMsg(error);
|
||||
this.setState({
|
||||
formErrorMsg: errorMsg,
|
||||
submitBtnDisabled: false
|
||||
|
Reference in New Issue
Block a user