# Boost Exception

### get_error_info

#include <boost/exception/info.hpp>

    namespace
    boost
        {
        template <class ErrorInfo,class E>
        shared_ptr<typename ErrorInfo::value_type const> get_error_info( E const & x );
        }

#### Requirements:

- ErrorInfo must be an instance of the error_info template.
- E must be polymorphic.

#### Returns:

- If dynamic_cast<boost::exception const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is an empty shared_ptr.
- Otherwise, the returned shared_ptr points to the stored value (use operator<< to store values in exception objects.) The shared_ptr is valid even after x has been destroyed.

#### Throws:

Nothing.

### See Also:

Boost Exception
boost/exception/info.hpp
error_info
exception