search for: typed_error

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

2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...functions that use the custom RTTI system to inspect > and handle typed errors. For example 'catchAllTypedErrors' and > 'handleTypedError' cooperate to handle error instances in a type-safe way: > > TypedError foo() { > if (SomeFailureCondition) > return make_typed_error<MyCustomError>(); > } > > TypedError Err = foo(); > > catchAllTypedErrors(std::move(Err), > handleTypedError<MyCustomError>( > [](std::unique_ptr<MyCustomError> E) { > // Handle the error. > return TypedError(); // <- Indicate succes...
2016 Feb 03
13
[RFC] Error handling in LLVM libraries.
...rs. }; 3. A set of utility functions that use the custom RTTI system to inspect and handle typed errors. For example 'catchAllTypedErrors' and 'handleTypedError' cooperate to handle error instances in a type-safe way: TypedError foo() { if (SomeFailureCondition) return make_typed_error<MyCustomError>(); } TypedError Err = foo(); catchAllTypedErrors(std::move(Err), handleTypedError<MyCustomError>( [](std::unique_ptr<MyCustomError> E) { // Handle the error. return TypedError(); // <- Indicate success from handler. } ) ); If your init...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...;>> inspect and handle typed errors. For example 'catchAllTypedErrors' and >>> 'handleTypedError' cooperate to handle error instances in a type-safe way: >>> >>> TypedError foo() { >>> if (SomeFailureCondition) >>> return make_typed_error<MyCustomError>(); >>> } >>> >>> TypedError Err = foo(); >>> >>> catchAllTypedErrors(std::move(Err), >>> handleTypedError<MyCustomError>( >>> [](std::unique_ptr<MyCustomError> E) { >>> // Handle the...
2016 Feb 03
6
[RFC] Error handling in LLVM libraries.
...ustom RTTI system to inspect >> and handle typed errors. For example 'catchAllTypedErrors' and >> 'handleTypedError' cooperate to handle error instances in a type-safe way: >> >> TypedError foo() { >> if (SomeFailureCondition) >> return make_typed_error<MyCustomError>(); >> } >> >> TypedError Err = foo(); >> >> catchAllTypedErrors(std::move(Err), >> handleTypedError<MyCustomError>( >> [](std::unique_ptr<MyCustomError> E) { >> // Handle the error. >> return Ty...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...d handle typed errors. For example 'catchAllTypedErrors' and >>>> 'handleTypedError' cooperate to handle error instances in a type-safe way: >>>> >>>> TypedError foo() { >>>> if (SomeFailureCondition) >>>> return make_typed_error<MyCustomError>(); >>>> } >>>> >>>> TypedError Err = foo(); >>>> >>>> catchAllTypedErrors(std::move(Err), >>>> handleTypedError<MyCustomError>( >>>> [](std::unique_ptr<MyCustomError> E) { >...
2016 Feb 03
2
[RFC] Error handling in LLVM libraries.
...ns that use the custom RTTI system to inspect and handle typed errors. For example 'catchAllTypedErrors' and 'handleTypedError' cooperate to handle error instances in a type-safe way: >> >> TypedError foo() { >> if (SomeFailureCondition) >> return make_typed_error<MyCustomError>(); >> } >> >> TypedError Err = foo(); >> >> catchAllTypedErrors(std::move(Err), >> handleTypedError<MyCustomError>( >> [](std::unique_ptr<MyCustomError> E) { >> // Handle the error. >> return...