Skip to content

Commit 73a3f98

Browse files
TimHarkerMarkPieszak
authored andcommitted
User Rest API Demo - Error Handling (TrilonIO#242)
* User Rest API Demo - Error Handling Fixed error handling to actually show the alert, on error. * Console Log Changed from `alert` to `console.log`.
1 parent 3917aea commit 73a3f98

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Client/app/components/user-detail/user-detail.component.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ export class UserDetailComponent {
1515
updateUser(user) {
1616
this.userService.updateUser(user).subscribe(result => {
1717
console.log('Put user result: ', result);
18-
if (!result.ok) {
19-
alert('There was an issue, Could not edit user');
20-
}
18+
}, error => {
19+
console.log(`There was an issue. ${error._body}.`);
2120
});
2221
}
2322
}

0 commit comments

Comments
 (0)