1 //Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. 2 3 //Distributed under the Boost Software License, Version 1.0. (See accompanying 4 //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 //This example shows how to print all data contained in a boost::exception. 7 8 #include <boost/exception/all.hpp> 9 #include <iostream> 10 11 void f(); //throws unknown types that derive from boost::exception. 12 13 void g()14g() 15 { 16 try 17 { 18 f(); 19 } 20 catch( 21 boost::exception & e ) 22 { 23 std::cerr << diagnostic_information(e); 24 } 25 } 26