-
Notifications
You must be signed in to change notification settings - Fork 58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Execption handling #10
Comments
so 404 is a valid response do think there's any issue with API. You will need to probably catch 404 using try catch |
https://github.com/codenix-sv/coingecko-api/blob/master/src/Api/Api.php
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If i try to get coin data there no exists, it will a execption come.
Client error:
GET https://api.coingecko.com/api/v3/coins/beluga.fi?tickers=true&market_data=true&sparkline=true` resulted in a404 Not Found
response: {"error":"Could not find coin with the given id"} `This Execption cant be catcht, because there are come from GUZZLE Client.
How can i catch these exeptions?
Currently i have to change the CoinGeckoClient Constructor and add a new parameter, like
$this->httpClient = $client ?: new Client(['base_uri' => self::BASE_URI, 'http_errors' => false]);
That feel like bad.
The text was updated successfully, but these errors were encountered: