Skip to content

Commit

Permalink
Properly handle LSF errors (HumanSignal#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-skriabin authored Sep 1, 2021
1 parent f768031 commit bdccf14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions label_studio/frontend/src/pages/DataManager/DataManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { NavLink } from 'react-router-dom';
import { Button } from '../../components/Button/Button';
import { modal } from '../../components/Modal/Modal';
import { Space } from '../../components/Space/Space';
import { useAPI } from '../../providers/ApiProvider';
import { useLibrary } from '../../providers/LibraryProvider';
import { useProject } from '../../providers/ProjectProvider';
import { useContextProps, useFixedLocation, useParams } from '../../providers/RoutesProvider';
Expand Down Expand Up @@ -51,6 +52,7 @@ export const DataManagerPage = ({...props}) => {
const root = useRef();
const params = useParams();
const history = useHistory();
const api = useAPI();
const LabelStudio = useLibrary('lsf');
const DataManager = useLibrary('dm');
const setContextProps = useContextProps();
Expand Down Expand Up @@ -85,6 +87,10 @@ export const DataManagerPage = ({...props}) => {
history.push(buildLink("/data/export", {id: params.id}));
});

dataManager.on("error", response => {
api.handleError(response);
});

setContextProps({dmRef: dataManager});
}, [LabelStudio, DataManager]);

Expand Down

0 comments on commit bdccf14

Please sign in to comment.