Quiz: Handling Errors and Application Debugging

Test your understanding of handling errors and debugging an Angular application.

1

Suppose we want to catch an error in an HTTP request. Which is the correct approach for it?

A)
catchError((error: HttpErrorResponse) => {
      console.error(error);
      return throwError(() => error);
})
B)
catchError((HttpErrorResponse: error) => {
      console(error);
      return throwError(() => error);
})
C)
catchError((HttpErrorResponse:error) => {
      console.error(error);
      return error;
})
D)
catchError((error: HttpErrorResponse) => {
      console.error(error);
      return throwError();
})
Question 1 of 50 attempted

Get hands-on with 1200+ tech skills courses.