diff options
-rw-r--r-- | part2/phonebook/src/App.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/part2/phonebook/src/App.js b/part2/phonebook/src/App.js index fa46962..0de0544 100644 --- a/part2/phonebook/src/App.js +++ b/part2/phonebook/src/App.js @@ -94,6 +94,10 @@ const App = () => { .create(newPerson) .then(response => console.log(response)) + .catch(error => { + console.log(error.response.data.error) + setErrorMessage(error.response.data.error) + }) setPersons(persons.concat(newPerson)) } } |