MCPcopy Create free account
hub / github.com/catboost/catboost / GetHttpCode

Function GetHttpCode

library/cpp/neh/http_common.cpp:235–260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

233 }
234
235 HttpCodes GetHttpCode(const IRequest::TResponseError& error) {
236 switch (error) {
237 case IRequest::TResponseError::BadRequest:
238 return HttpCodes::HTTP_BAD_REQUEST;
239 case IRequest::TResponseError::Forbidden:
240 return HttpCodes::HTTP_FORBIDDEN;
241 case IRequest::TResponseError::NotExistService:
242 return HttpCodes::HTTP_NOT_FOUND;
243 case IRequest::TResponseError::TooManyRequests:
244 return HttpCodes::HTTP_TOO_MANY_REQUESTS;
245 case IRequest::TResponseError::InternalError:
246 return HttpCodes::HTTP_INTERNAL_SERVER_ERROR;
247 case IRequest::TResponseError::NotImplemented:
248 return HttpCodes::HTTP_NOT_IMPLEMENTED;
249 case IRequest::TResponseError::BadGateway:
250 return HttpCodes::HTTP_BAD_GATEWAY;
251 case IRequest::TResponseError::ServiceUnavailable:
252 return HttpCodes::HTTP_SERVICE_UNAVAILABLE;
253 case IRequest::TResponseError::BandwidthLimitExceeded:
254 return HttpCodes::HTTP_BANDWIDTH_LIMIT_EXCEEDED;
255 case IRequest::TResponseError::MaxResponseError:
256 ythrow yexception() << TStringBuf("unknow type of error");
257
258 Y_UNREACHABLE();
259 }
260 }
261}
262

Callers 1

WriteHttpCodeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected