Skip to content

Commit

Permalink
docs: updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
darseen committed Aug 11, 2024
1 parent f44c04c commit 31f6107
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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);
}
}
}

Expand Down

0 comments on commit 31f6107

Please sign in to comment.