We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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 a 404 Not Found response: {"error":"Could not find coin with the given id"} `
Client error:
404 Not Found
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:
so 404 is a valid response do think there's any issue with API. You will need to probably catch 404 using try catch
Sorry, something went wrong.
https://github.com/codenix-sv/coingecko-api/blob/master/src/Api/Api.php
public function get(string $uri, array $query = []): array { try { $response = $this->client->getHttpClient()->request('GET', '/api/' . $this->version . $uri, ['query' => $query]); } catch (\Exception $e) { $response = $e->getResponse(); } $this->client->setLastResponse($response); return $this->transformer->transform($response); }
No branches or pull requests
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: