public function validateKey()
    {
        try {
            $this->api->get('');
        } catch (\Exception $e) {
            if (starts_with($e->getMessage(), '{')) {
                $json = json_decode($e->getMessage());
                if ($json->status == 401) {
                    throw new InvalidApiKey($json->detail);
                }
            }

            throw $e;
        }
    }
public function validateKey()
    {
        try {
            $this->api->get('');
        } catch (\Exception $e) {
            if (starts_with($e->getMessage(), '{')) {
                $json = json_decode($e->getMessage());
                if ($json->status == 401) {
                    throw new InvalidApiKey($json->detail);
                }
            }

            throw $e;
        }
    }
public function validateKey ( ) { try { $ this -> api -> get ( '' ) ; } catch ( \ Exception $ e ) { if ( starts_with ( $ e -> getMessage ( ) , '{' ) ) { $ json = json_decode ( $ e -> getMessage ( ) ) ; if ( $ json -> status == 401 ) { throw new InvalidApiKey ( $ json -> detail ) ; } } throw $ e ; } }
Determine if an API key is valid

@throws InvalidApiKey
@throws \Exception
Determine if an API key is valid