| 1705 | } |
| 1706 | |
| 1707 | inline std::string to_string(const Error error) { |
| 1708 | switch (error) { |
| 1709 | case Error::Success: return "Success (no error)"; |
| 1710 | case Error::Connection: return "Could not establish connection"; |
| 1711 | case Error::BindIPAddress: return "Failed to bind IP address"; |
| 1712 | case Error::Read: return "Failed to read connection"; |
| 1713 | case Error::Write: return "Failed to write connection"; |
| 1714 | case Error::ExceedRedirectCount: return "Maximum redirect count exceeded"; |
| 1715 | case Error::Canceled: return "Connection handling canceled"; |
| 1716 | case Error::SSLConnection: return "SSL connection failed"; |
| 1717 | case Error::SSLLoadingCerts: return "SSL certificate loading failed"; |
| 1718 | case Error::SSLServerVerification: return "SSL server verification failed"; |
| 1719 | case Error::UnsupportedMultipartBoundaryChars: |
| 1720 | return "Unsupported HTTP multipart boundary characters"; |
| 1721 | case Error::Compression: return "Compression failed"; |
| 1722 | case Error::ConnectionTimeout: return "Connection timed out"; |
| 1723 | case Error::Unknown: return "Unknown"; |
| 1724 | default: break; |
| 1725 | } |
| 1726 | |
| 1727 | return "Invalid"; |
| 1728 | } |
| 1729 | |
| 1730 | inline std::ostream &operator<<(std::ostream &os, const Error &obj) { |
| 1731 | os << to_string(obj); |
no outgoing calls
no test coverage detected