Skip to content

Instantly share code, notes, and snippets.

Created August 10, 2017 08:03
What would you like to do?
data => {
console.log("Titre: " + data.title);
(err: HttpErrorResponse) => {
if (err.error instanceof Error) {
// A client-side or network error occurred. Handle it accordingly.
console.log('An error occurred:', err.error.message);
} else {
// The backend returned an unsuccessful response code.
// The response body may contain clues as to what went wrong,
console.log(`Backend returned code ${err.status}, body was: ${err.error}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment