title: Httpclient request in angular json error
body: <p>I am doing http client request</p>
  
  <pre><code>export class MapjsonService{
    theUrl = 'http://localhost:4200/api/Lat_Long.json';
    constructor(private http: HttpClient) { }
  
    fetchNews(): Observable&lt;any&gt;{
      return this.http.get(this.theUrl)
    }
  </code></pre>
  
  <p>It is working about 99.99% of the time sadly this is running so often that is fails like once every 10 mins with</p>
  
  <pre><code>HttpErrorResponse {headers: HttpHeaders, status: 200, statusText: "OK", url: "http://localhost:4200/api/Lat_Long.json", ok: false, …}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>"Http failure during parsing for http://localhost:4200/api/Lat_Long.json"
  </code></pre>
  
  <p>Now I figured out for some reason my nrql query from newrelic (which is what is being stored in '/api/lat_long.json' does not have the final closing '}' once every orange moon. and this is what is throwing this error.  my question is there any whay for me to check if the returned value is valid json and if it is not try the <code>GET</code> request again without terminating the process that called it.  Thx</p>