summaryrefslogtreecommitdiffstats
path: root/frontend/lib/catchError.js
blob: 581d2f3ed12a92127fda835e8a95c75ded0f2d0f (plain)
1
2
3
4
5
6
7
8
const catchError = function(fn) {
  return (...args) =>
    fn(...args).catch(error => {
      this.setState({ error });
    });
};

export default catchError;