Skip to content

Execption handling #10

@mascoda

Description

@mascoda

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"} `

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions