| 1588 | } |
| 1589 | |
| 1590 | inline std::string to_string(const Error error) { |
| 1591 | switch (error) { |
| 1592 | case Error::Success: return "Success"; |
| 1593 | case Error::Connection: return "Connection"; |
| 1594 | case Error::BindIPAddress: return "BindIPAddress"; |
| 1595 | case Error::Read: return "Read"; |
| 1596 | case Error::Write: return "Write"; |
| 1597 | case Error::ExceedRedirectCount: return "ExceedRedirectCount"; |
| 1598 | case Error::Canceled: return "Canceled"; |
| 1599 | case Error::SSLConnection: return "SSLConnection"; |
| 1600 | case Error::SSLLoadingCerts: return "SSLLoadingCerts"; |
| 1601 | case Error::SSLServerVerification: return "SSLServerVerification"; |
| 1602 | case Error::UnsupportedMultipartBoundaryChars: |
| 1603 | return "UnsupportedMultipartBoundaryChars"; |
| 1604 | case Error::Compression: return "Compression"; |
| 1605 | case Error::ConnectionTimeout: return "ConnectionTimeout"; |
| 1606 | case Error::Unknown: return "Unknown"; |
| 1607 | default: break; |
| 1608 | } |
| 1609 | |
| 1610 | return "Invalid"; |
| 1611 | } |
| 1612 | |
| 1613 | inline std::ostream &operator<<(std::ostream &os, const Error &obj) { |
| 1614 | os << to_string(obj); |
no outgoing calls