You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

middleware.js 902B

123456789101112131415161718192021222324252627
  1. // @flow
  2. import { StateListenerRegistry } from '../base/redux';
  3. import { setFatalError } from './actions';
  4. declare var APP: Object;
  5. /**
  6. * State listener which emits the {@code fatalErrorOccurred} action which works
  7. * as a catch all for critical errors which have not been claimed by any other
  8. * feature for error recovery (the recoverable flag is not set).
  9. */
  10. StateListenerRegistry.register(
  11. /* selector */ state => {
  12. const { error: conferenceError } = state['features/base/conference'];
  13. const { error: configError } = state['features/base/config'];
  14. const { error: connectionError } = state['features/base/connection'];
  15. return configError || connectionError || conferenceError;
  16. },
  17. /* listener */ (error, { dispatch }) => {
  18. error
  19. && typeof error.recoverable === 'undefined'
  20. && dispatch(setFatalError(error));
  21. }
  22. );