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

Class TSimpleException

library/cpp/yt/exception/exception.h:15–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13// a limited subset of core libraries that are needed to implement NYT::TError.
14
15class TSimpleException
16 : public std::exception
17{
18public:
19 using TAttributes = THashMap<
20 TExceptionAttribute::TKey,
21 TExceptionAttribute::TValue>;
22
23 template <class TValue>
24 static constexpr bool CNestable = requires (TSimpleException& ex, TValue&& operand) {
25 { ex <<= std::forward<TValue>(operand) } -> std::same_as<TSimpleException&>;
26 };
27
28 explicit TSimpleException(std::string message);
29 TSimpleException(
30 const std::exception& exception,
31 std::string message);
32
33 const std::exception_ptr& GetInnerException() const;
34 const char* what() const noexcept override;
35
36 const std::string& GetMessage() const;
37
38 const TAttributes& GetAttributes() const &;
39 TAttributes&& GetAttributes() &&;
40
41 TSimpleException& operator<<= (TExceptionAttribute&& attribute) &;
42 TSimpleException& operator<<= (std::vector<TExceptionAttribute>&& attributes) &;
43 TSimpleException& operator<<= (TAttributes&& attributes) &;
44
45 TSimpleException& operator<<= (const TExceptionAttribute& attribute) &;
46 TSimpleException& operator<<= (const std::vector<TExceptionAttribute>& attributes) &;
47 TSimpleException& operator<<= (const TAttributes& attributes) &;
48
49 // NB: clang is incapable of parsing such requirements (which refer back to the class) out-of-line.
50 // To keep this overload from winning in resolution
51 // when constraint actually fails, we define method right here.
52 template <class TValue>
53 requires CNestable<TValue>
54 TSimpleException&& operator<< (TValue&& value) &&
55 {
56 return std::move(*this <<= std::forward<TValue>(value));
57 }
58
59 template <class TValue>
60 requires CNestable<TValue>
61 TSimpleException operator<< (TValue&& value) const &
62 {
63 return TSimpleException(*this) << std::forward<TValue>(value);
64 }
65
66private:
67 const std::exception_ptr InnerException_;
68 const std::string Message_;
69 const std::string What_;
70
71 TAttributes Attributes_;
72};

Callers 15

ReadVarUint32Function · 0.85
ReadVarUint64Function · 0.85
ReadVarUint64ImplFunction · 0.85
ReadVarUint64FallbackFunction · 0.85
ReadVarUint32ImplFunction · 0.85
ReadVarInt32ImplFunction · 0.85
operator<<Method · 0.85
FromStringMethod · 0.85
FromStringHex32Method · 0.85
FromStringMethod · 0.85
CheckedIntegralCastFunction · 0.85
CheckedEnumCastFunction · 0.85

Calls 1

moveFunction · 0.50

Tested by

no test coverage detected