I get "Http failure response for (unknown url): 0 Unknown Error" instead of actual error...

Discussão em 'Angular' iniciado por grdl, Dezembro 16, 2024.

  1. grdl

    grdl Guest

    I'm using Angular 4 HttpClient to send requests to external service. It is a very standard setup:

    this.httpClient.get(url).subscribe(response => {
    //do something with response
    }, err => {
    console.log(err.message);
    }, () => {
    console.log('completed');
    }


    The problem is, when the request fails I see a generic Http failure response for (unknown url): 0 Unknown Error message in console. Meanwhile, when I inspect the failed request in chrome I can see the response status is 422, and in the "preview" tab I see the actual message desribing failure cause.

    How do I access the actual response message I can see in chrome dev tools?

    Here's a screenshot demonstrating the problem: [​IMG]

    Continue reading...

Compartilhe esta Página