2009-04-07 03:02:15 +00:00
|
|
|
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
2008-03-04 01:41:17 +00:00
|
|
|
|
|
|
|
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
|
|
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
|
|
|
|
|
|
|
//This example shows to print all data contained in a boost::exception.
|
|
|
|
|
|
|
|
#include <boost/exception.hpp>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
void f(); //throws unknown types that derive from boost::exception.
|
|
|
|
|
|
|
|
void
|
|
|
|
g()
|
2008-04-08 21:29:37 +00:00
|
|
|
{
|
2008-03-04 01:41:17 +00:00
|
|
|
try
|
2008-04-08 21:29:37 +00:00
|
|
|
{
|
2008-03-04 01:41:17 +00:00
|
|
|
f();
|
2008-04-08 21:29:37 +00:00
|
|
|
}
|
2008-03-04 01:41:17 +00:00
|
|
|
catch(
|
2008-04-08 21:29:37 +00:00
|
|
|
boost::exception & e )
|
|
|
|
{
|
2008-09-01 21:06:09 +00:00
|
|
|
std::cerr << diagnostic_information(e);
|
2008-04-08 21:29:37 +00:00
|
|
|
}
|
|
|
|
}
|