I have this Http Call:
getSomething(): Observable<MyTypedClass> {
return this.httpClient.post<MyTypedClass>(this._url, httpOptions)
.pipe(
catchError(this.formatErrors)
);
}
Where MyTypedClass.ts look like this:
export class MyTypedClass {
code: string;
state: string;
}
JSON Response (Missmatch MyTypedClass):
{ "code": "INF00001", "test":true }
Since my JSON response does not match MyTypedClass for test purposes.
Question: Should I expect the HttpClient throws some missmatch or parse error and fires the error function on subscribers?