title: Is it possible to throw errors inside ngrx-effects without completing the Observable stream?
body: <p>Is there any way to use <code>throw</code> with an Error object inside ngrx-effects streams without completing the stream?</p>
  
  <p>I've read these great answers on why the stream is being killed by throwing an error:</p>
  
  <p><a href="https://stackoverflow.com/questions/44180361/ngrx-effect-does-not-run-the-second-time/44180463#44180463">@ngrx Effect does not run the second time</a></p>
  
  <p><a href="https://stackoverflow.com/questions/41685519/ngrx-effects-error-handling/41685689#41685689">ngrx effects error handling</a></p>
  
  <p><a href="https://github.com/ngrx/platform/issues/646" rel="nofollow noreferrer">https://github.com/ngrx/platform/issues/646</a></p>
  
  <p>My question is if I'm implementing the Angular <code>ErrorHandler</code> to catch errors, if I'm going to be able to use that with ngrx effects.</p>
  
  <pre><code>@Effect()
    loginUserEffect: Observable&lt;loginActions.Actions&gt; = this.actions$
      .ofType(loginActions.LOGIN_USER)
      .map((action: loginActions.LoginUser) =&gt; action.payload)
      .mergeMap(payload =&gt; {
        return this.loginService
          .authenticate(payload)
          .map(response =&gt; new loginActions.LoginUserSuccess(response))
          .catch((error: HttpErrorResponse) =&gt;
            of(new loginActions.LoginUserFailure(error))
          )
    })
  
    @Effect({ dispatch: false })
    loginUserEffectSuccess$ = this.actions$
      .ofType(loginActions.LOGIN_USER_SUCCESS)
      .do(() =&gt; this.router.navigate(['/account-home']))
  
    @Effect({ dispatch: false })
    loginUserEffectFailure$ = this.actions$
      .ofType(loginActions.LOGIN_USER_FAILURE)
      .map((action: loginActions.LoginUserFailure) =&gt; {
        throw action.payload // Stream completes
    })
  </code></pre>
  
  <p>I imagine I could create some way of dealing with errors that doesn't involve throwing anything, but wanted to make sure I needed to go that route or if there was a way to keep both of them peacefully coexisting.</p>
  
  <p>Currently in my class that implements <code>ErrorHander</code>, I have this:</p>
  
  <pre><code>@Injectable()
  export class GlobalErrorHandler implements ErrorHandler {
    private messagesService: MessagesService
    private router: Router
  
    constructor(
      private injector: Injector, // DI workaround (https://stackoverflow.com/a/41585902)
      private errorLoggerService: ErrorLoggerService
    ) {
      // DI workaround (https://stackoverflow.com/a/41585902)
      setTimeout(() =&gt; (this.messagesService = injector.get(MessagesService)))
      setTimeout(() =&gt; (this.router = injector.get(Router)))
    }
  
    handleError(error) {
      if (error instanceof HttpErrorResponse) {
        this.handleServerError(error)
      } else if (error instanceof ClientError) {
        this.handleClientError(error)
      } else {
        this.handleUnexpectedError(error)
      }
    }
  </code></pre>
  
  <p>Which means I just throw errors and they are handled based on the type</p>