http_code_extractor.h 645 B

12345678910111213141516
  1. #pragma once
  2. #include <library/cpp/http/misc/httpcodes.h>
  3. #include <util/generic/maybe.h>
  4. #include <util/generic/strbuf.h>
  5. namespace NRainCheck {
  6. // Try to get HttpCode from library/cpp/neh response.
  7. // If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message
  8. // "library/cpp/neh/http.cpp:<LINE>: request failed(<FIRST-HTTP-RESPONSE-LINE>)"
  9. // (see library/cpp/neh/http.cpp:625). So, we will try to parse this message and
  10. // find out HttpCode in it. It is bad temporary solution, but we have no choice.
  11. TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage);
  12. }