From 090141db1f8874814fef6f584eacd2567192868d Mon Sep 17 00:00:00 2001 From: Justin Poehnelt Date: Wed, 3 Jun 2020 13:28:01 -0700 Subject: [PATCH] docs: update example without switch on status (#410) --- README.md | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c34e8d2479..a118d9866d 100644 --- a/README.md +++ b/README.md @@ -66,14 +66,10 @@ client timeout: 1000, // milliseconds }) .then((r) => { - if (r.data.status === Status.OK) { - console.log(r.data.results[0].elevation); - } else { - console.log(r.data.error_message); - } + console.log(r.data.results[0].elevation); }) .catch((e) => { - console.log(e); + console.log(e.response.data.error_message); }); ```