|
C++ YT Wrapper
C++ library for working with YT clusters
|
Error returned by YT cluster. More...
#include <errors.h>
Public Member Functions | |
| TYtError () | |
| Constructs error with NYT::NClusterErrorCodes::OK code and empty message. | |
| TYtError (const TString &message) | |
| Constructs error with NYT::NClusterErrorCodes::Generic code and given message. | |
| TYtError (int code, TString message, TVector< TYtError > inner={}, TNode::TMapType attributes={}) | |
| Constructs error from given parameters. | |
| TYtError (const ::NJson::TJsonValue &value) | |
| Construct error from json representation. | |
| TYtError (const TNode &value) | |
| Construct error from TNode representation. | |
| bool | ContainsErrorCode (int code) const |
| Check if error or any of inner errors has given error code. | |
| TString | ShortDescription () const |
| Get short description of error. | |
| TString | FullDescription () const |
| Get full description of error. | |
| int | GetCode () const |
| Get error code of the topmost error. | |
| const TString & | GetMessage () const |
| Get error text of the topmost error. | |
| bool | ContainsText (const TStringBuf &text) const |
| Check if error or any of inner errors contains given text chunk. | |
| const TVector< TYtError > & | InnerErrors () const |
| Get inner errors. | |
| void | ParseFrom (TStringBuf jsonError) |
| Parse error from json string. | |
| TSet< int > | GetAllErrorCodes () const |
| Collect error codes from entire error tree. | |
| bool | HasAttributes () const |
| Check if error has any attributes. | |
| const TNode::TMapType & | GetAttributes () const |
| Get error attributes. | |
| TString | GetYsonText () const |
| Get text yson representation of error. | |
Error returned by YT cluster.
An object of this class describe error that happened on YT server. Internally each error is a tree. Each node of the tree contains:
To get text description of an error one should use NYT::TYtError::ShortDescription or NYT::TYtError::FullDescription
To distinguish between error kinds NYT::TYtError::ContainsErrorCode should be used.
| bool NYT::TYtError::ContainsErrorCode | ( | int | code | ) | const |
Check if error or any of inner errors has given error code.
Use this method to distinguish kind of error.
| bool NYT::TYtError::ContainsText | ( | const TStringBuf & | text | ) | const |
Check if error or any of inner errors contains given text chunk.
| TString NYT::TYtError::FullDescription | ( | ) | const |
Get full description of error.
Full description contains readable short description followed by text yson representation of error that contains error codes and attributes.
| int NYT::TYtError::GetCode | ( | ) | const |
Get error code of the topmost error.
| const TString & NYT::TYtError::GetMessage | ( | ) | const |
Get error text of the topmost error.
| TString NYT::TYtError::ShortDescription | ( | ) | const |
Get short description of error.
Short description contain text description of error and all inner errors. It is human readable but misses some important information (error codes, error attributes).
Usually it's better to use NYT::TYtError::FullDescription to log errors.