protected function parseClientException(ClientException $exception)
    {
        $response = $exception->getResponse();

        $lines = explode("\n", $response->getBody());

        $message = 'Something went wrong';

        foreach ($lines as $line) {
            if (strpos($line, 'message') !== false) {
                $message = substr($line, 9);

                break;
            }
        }

        throw new FlexClientException($message, 0);
    }