search for: typederrorinfobase

Displaying 6 results from an estimated 6 matches for "typederrorinfobase".

2016 Feb 03
13
[RFC] Error handling in LLVM libraries.
...at tracks whether the error has been handled or not. If a TypedError is ever destructed without being checked (or passed on to someone else) it will call std::terminate(). TypedError cannot be silently dropped. 2. A utility class, TypedErrorInfo, for building error class hierarchies rooted at 'TypedErrorInfoBase' with custom RTTI. E.g. // Define a new error type implicitly inheriting from TypedErrorInfoBase. class MyCustomError : public TypedErrorInfo<MyCustomError> { public: // Custom error info. }; // Define a subclass of MyCustomError. class MyCustomSubError : public TypedErrorInfo<MyCu...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...g the error triggers an error (this > is the "hard to misuse” part of API design IMO). > You don’t mention it, but I’d rather see this “checked” flag compiled out > with NDEBUG. > > > 2. A utility class, TypedErrorInfo, for building error class hierarchies > rooted at 'TypedErrorInfoBase' with custom RTTI. E.g. > > // Define a new error type implicitly inheriting from TypedErrorInfoBase. > class MyCustomError : public TypedErrorInfo<MyCustomError> { > public: > // Custom error info. > }; > > // Define a subclass of MyCustomError. > class MyCus...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...gt; method) the call goes to the parent TypedErrorInfo object, which compares > T's ID with its own. If it matches it returns true, if it doesn't match > then the call gets forwarded to the parent class, then its parent class, > and so on. If you hit the root of the type-tree (i.e. TypedErrorInfoBase) > without matching the ID, then you weren't a subclass of T. > > > Nice, and since this is on the error path we don’t care if it is not “as > fast as” the custom LLVM RTTI. > > > > Sure, this case shows “success” of the handler, now what is a failure > of the hand...
2016 Feb 03
6
[RFC] Error handling in LLVM libraries.
...e isSameOrSubClass method) the call goes to the parent TypedErrorInfo object, which compares T's ID with its own. If it matches it returns true, if it doesn't match then the call gets forwarded to the parent class, then its parent class, and so on. If you hit the root of the type-tree (i.e. TypedErrorInfoBase) without matching the ID, then you weren't a subclass of T. > Sure, this case shows “success” of the handler, now what is a failure of the handler and how is it handled? Sorry - that was a bad example to choose: That was actually showcasing failure, not success. Success looks like this: T...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...the error has been handled or not. If a TypedError is ever destructed without being checked (or passed on to someone else) it will call std::terminate(). TypedError cannot be silently dropped. >> >> 2. A utility class, TypedErrorInfo, for building error class hierarchies rooted at 'TypedErrorInfoBase' with custom RTTI. E.g. >> >> // Define a new error type implicitly inheriting from TypedErrorInfoBase. >> class MyCustomError : public TypedErrorInfo<MyCustomError> { >> public: >> // Custom error info. >> }; >> >> // Define a subclass...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...the call goes to the parent TypedErrorInfo object, which compares >> T's ID with its own. If it matches it returns true, if it doesn't match >> then the call gets forwarded to the parent class, then its parent class, >> and so on. If you hit the root of the type-tree (i.e. TypedErrorInfoBase) >> without matching the ID, then you weren't a subclass of T. >> >> >> Nice, and since this is on the error path we don’t care if it is not “as >> fast as” the custom LLVM RTTI. >> >> >> > Sure, this case shows “success” of the handler, now wh...