title: Angular catching a 404 file not found error while using ngx-doc-viewer
body: <p>I have implemented ngx-doc-viewer to be able to render docx files in my webapp. Since the webapp is multilanguage, I do have different docx for every implemented language and I do load the correct docx, depending on the current language selected. Now I would like to handle the scenario where the docx file of a certain language is, for some reason, missing which will lead me to load a default docx file (let's say the english one). I think I need to somehow catch the response error I get in the console, when the component cannot find the target file, but I don't know how. Can you help me please? Thanks!!</p>
  <p>Here's some of my code:</p>
  <p>HTML:</p>
  <pre><code>&lt;mat-dialog-content class=&quot;text&quot;&gt;
      &lt;ngx-doc-viewer [url]=&quot;docUrl&quot; [viewer]=&quot;viewer&quot;&gt;&lt;/ngx-doc-viewer&gt;
  &lt;/mat-dialog-content&gt;
  </code></pre>
  <p>TS:</p>
  <pre><code>import { Component, Inject, OnInit } from '@angular/core';
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
  import { viewerType } from 'ngx-doc-viewer';
  
  @Component({
    selector: 'app-privacy-text',
    templateUrl: './privacy-text.component.html',
    styleUrls: ['./privacy-text.component.scss']
  })
  export class PrivacyTextComponent implements OnInit {
  
    docLanguage = navigator.language.split('-')[1].toString().toLocaleLowerCase();
  
    viewer: viewerType; // google, office, mammoth, pdf, url
    docUrl = '';
  
    constructor(
      @Inject(MAT_DIALOG_DATA) public data: {width: string, height: string}) { }
  
    ngOnInit(): void {
      this.viewer = 'mammoth';
      this.docUrl = 'assets/docs/terms_and_conditions-' + this.docLanguage + &quot;.docx&quot;;
    }
  
  }
  </code></pre>
  <p>CONSOLE error msg:</p>
  <p>GET http://localhost:4200/assets/docs/terms_and_conditions-it.docx   [HTTP/1.1 404 Not Found 5ms]</p>
  <p>Response:</p>
  <p>Cannot GET /assets/docs/terms_and_conditions-it.docx</p>