| 90 | } |
| 91 | |
| 92 | void demonstrate_network_errors() { |
| 93 | std::cout << "3. Network Error Simulation\n"; |
| 94 | std::cout << "===========================\n\n"; |
| 95 | |
| 96 | // Test with non-existent base URL (this would typically be done with client |
| 97 | // config) |
| 98 | std::cout << "Network errors are typically handled internally.\n"; |
| 99 | std::cout << "Common network errors include:\n"; |
| 100 | std::cout << " - Connection timeouts\n"; |
| 101 | std::cout << " - DNS resolution failures\n"; |
| 102 | std::cout << " - SSL/TLS certificate errors\n"; |
| 103 | std::cout << " - Rate limiting (HTTP 429)\n"; |
| 104 | std::cout << " - Server errors (HTTP 5xx)\n\n"; |
| 105 | |
| 106 | // Demonstrate rate limiting handling |
| 107 | std::cout << "The SDK automatically handles:\n"; |
| 108 | std::cout << " - Retries with exponential backoff\n"; |
| 109 | std::cout << " - Rate limit respect\n"; |
| 110 | std::cout << " - Connection pooling\n"; |
| 111 | std::cout << " - Timeout management\n\n"; |
| 112 | } |
| 113 | |
| 114 | void demonstrate_streaming_errors() { |
| 115 | std::cout << "4. Streaming Error Handling\n"; |