proxygen
HTTPException.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015-present, Facebook, Inc.
3  * All rights reserved.
4  *
5  * This source code is licensed under the BSD-style license found in the
6  * LICENSE file in the root directory of this source tree. An additional grant
7  * of patent rights can be found in the PATENTS file in the same directory.
8  *
9  */
10 
11 #include <sstream>
12 #include <string>
13 
15 
16 namespace proxygen {
17 
19  std::stringstream ss;
20  ss << *this;
21  return ss.str();
22 }
23 
24 std::ostream& operator<<(std::ostream& os, const HTTPException& ex) {
25  os << "what=\"" << ex.what()
26  << "\", direction=" << static_cast<int>(ex.getDirection())
27  << ", proxygenError=" << getErrorString(ex.getProxygenError())
28  << ", codecStatusCode=" << (ex.hasCodecStatusCode() ?
30  "-1")
31  << ", httpStatusCode=" << ex.getHttpStatusCode();
32  return os;
33 }
34 
35 }
ProxygenError getProxygenError() const
Definition: Exception.h:50
std::ostream & operator<<(std::ostream &os, const HeaderTable &table)
bool hasCodecStatusCode() const
Definition: HTTPException.h:95
Direction getDirection() const
Definition: HTTPException.h:67
ErrorCode getCodecStatusCode() const
const char * getErrorCodeString(ErrorCode error)
Definition: ErrorCode.cpp:18
const char * string
Definition: Conv.cpp:212
uint32_t getHttpStatusCode() const
Definition: HTTPException.h:90
std::string describe() const
const char * what(void) const noexceptoverride
Definition: Exception.cpp:26
const char * getErrorString(ProxygenError error)