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

Method ReportError

library/cpp/yconf/conf.cpp:53–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53void TYandexConfig::ReportError(const char* ptr, const char* err, bool warning) {
54 if (ptr) {
55 char buf[1024];
56 int line = 0, col = 0;
57 if (!EndLines.empty()) {
58 TVector<const char*>::iterator I = UpperBound(EndLines.begin(), EndLines.end(), ptr);
59 if (I == EndLines.end())
60 I = EndLines.end() - 1;
61 line = int(I - EndLines.begin());
62 if (line)
63 I--;
64 col = int(ptr - (*I));
65 }
66 if (warning)
67 snprintf(buf, 1024, "Warning at line %d, col %d: %s.\n", line, col, err);
68 else
69 snprintf(buf, 1024, "Error at line %d, col %d: %s.\n", line, col, err);
70 Errors.push_back(buf);
71 } else
72 Errors.push_back(err);
73}
74
75void TYandexConfig::ReportError(const char* ptr, bool warning, const char* format, ...) {
76 va_list args;

Callers

nothing calls this directly

Calls 8

UpperBoundFunction · 0.85
vsnprintfFunction · 0.85
ReportErrorFunction · 0.85
snprintfFunction · 0.50
emptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected