Kompakkt / Repo

Repository for Kompakkt, the Web Based multimodal 3D Viewer and 3D Annotation System.
https://kompakkt.de
GNU Affero General Public License v3.0
12 stars 2 forks source link

Use Angular HttpInterceptors to better integrate with Angular HttpClient #8

Closed HeyItsBATMAN closed 1 year ago

HeyItsBATMAN commented 1 year ago

Previously, inside BackendService we used a get and post method to patch the requests made by Angular HttpClient with:

To improve extensibility of BackendService, all of these features have been moved to Angular HttpInterceptor services.

Additionally, HTTP error responses will now be logged and have their response body swapped with undefined in a new HttpErrorInterceptor. This was done to prevent having to .catch() errors everywhere in the application and make response data easily awaitable, as data either exists or not, while still receiving error information in the developer console.