summaryrefslogtreecommitdiffstats
path: root/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp
diff options
context:
space:
mode:
authorvartyukh <[email protected]>2022-02-10 16:50:16 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:50:16 +0300
commit97df5ca7413550bf233fc6c7210e292fca0a51af (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /library/cpp/messagebus/rain_check/http/http_code_extractor.cpp
parent18f9abdade80b500b7ea1ef2d286e2465a1c8466 (diff)
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/messagebus/rain_check/http/http_code_extractor.cpp')
-rw-r--r--library/cpp/messagebus/rain_check/http/http_code_extractor.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp
index 3d97899d3b9..51d75762f68 100644
--- a/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp
+++ b/library/cpp/messagebus/rain_check/http/http_code_extractor.cpp
@@ -1,13 +1,13 @@
-#include "http_code_extractor.h"
-
+#include "http_code_extractor.h"
+
#include <library/cpp/http/io/stream.h>
#include <library/cpp/http/misc/httpcodes.h>
#include <util/generic/maybe.h>
-#include <util/generic/strbuf.h>
-#include <util/string/cast.h>
-
-namespace NRainCheck {
+#include <util/generic/strbuf.h>
+#include <util/string/cast.h>
+
+namespace NRainCheck {
TMaybe<HttpCodes> TryGetHttpCodeFromErrorDescription(const TStringBuf& errorMessage) {
// Try to get HttpCode from library/cpp/neh response.
// If response has HttpCode and it is not 200 OK, library/cpp/neh will send a message
@@ -17,9 +17,9 @@ namespace NRainCheck {
const TStringBuf SUBSTR = "request failed(";
const size_t SUBSTR_LEN = SUBSTR.size();
const size_t FIRST_LINE_LEN = TStringBuf("HTTP/1.X NNN").size();
-
+
TMaybe<HttpCodes> httpCode;
-
+
const size_t substrPos = errorMessage.find(SUBSTR);
if (substrPos != TStringBuf::npos) {
const TStringBuf firstLineStart = errorMessage.SubStr(substrPos + SUBSTR_LEN, FIRST_LINE_LEN);
@@ -30,10 +30,10 @@ namespace NRainCheck {
}
} catch (const TFromStringException& ex) {
// Can't parse HttpCode: it is OK, because ErrorDescription can be random string.
- }
- }
+ }
+ }
return httpCode;
- }
-
-}
+ }
+
+}