How to use the redux-api-middleware.ApiError function in redux-api-middleware

To help you get started, we’ve selected a few redux-api-middleware examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dremio / dremio-oss / dac / ui / src / reducers / resources / view-spec.js View on Github external
it('should return details from response', () => {
      const error = new ApiError('status', 500, {details: 'details'});
      expect(getErrorDetails({payload: error})).to.equal('details');
    });
github dremio / dremio-oss / dac / ui / src / reducers / resources / view-spec.js View on Github external
it('should return message from response of ApiError if no response errorMessage', () => {
      const error = new ApiError('status', 500);
      expect(getErrorMessage({
        payload: error
      })).to.eql({
        errorMessage: error.message
      });
    });
github dremio / dremio-oss / dac / ui / src / reducers / resources / view-spec.js View on Github external
it('should return errorMessage from response of ApiError if present', () => {
      expect(getErrorMessage({
        payload: new ApiError('status', 500, {
          errorMessage: 'apiError'
        })
      })).to.eql({
        errorMessage: 'apiError'
      });
    });