From 31f6107d38e5cb7a92e0b4d19ae7d7a4f295cd2f Mon Sep 17 00:00:00 2001 From: darseen Date: Sun, 11 Aug 2024 18:29:06 +0300 Subject: [PATCH] docs: updated README.md --- README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fc387e9..1389f8b 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ To make your first API call, you will need to [register](https://developers.amad ## Usage ```ts -import Amadeus from "amadeus-ts"; +import Amadeus, { ResponseError } from "amadeus-ts"; const amadeus = new Amadeus({ clientId: "REPLACE_BY_YOUR_API_KEY", @@ -38,8 +38,10 @@ async function getFlightOffers() { adults: 2, }); console.log(response.data); - } catch (responseError) { - console.log(responseError.code); + } catch (responseError: unknown) { + if (responseError instanceof ResponseError) { + console.log(responseError.code); + } } }