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

Method CheckType

library/cpp/yson/token.cpp:188–198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 }
187
188 void TToken::CheckType(ETokenType expectedType) const {
189 if (Type_ != expectedType) {
190 if (Type_ == ETokenType::EndOfStream) {
191 ythrow TYsonException() << "Unexpected end of stream (ExpectedType: " << TokenTypeToString(expectedType) << ")";
192 } else {
193 ythrow TYsonException() << "Unexpected token (Token: '" << ToString(*this)
194 << "', Type: " << TokenTypeToString(Type_)
195 << ", ExpectedType: " << TokenTypeToString(expectedType) << ")";
196 }
197 }
198 }
199
200 void TToken::Reset() {
201 Type_ = ETokenType::EndOfStream;

Callers

nothing calls this directly

Calls 2

TokenTypeToStringFunction · 0.85
ToStringFunction · 0.70

Tested by

no test coverage detected