Files
exception/example/logging.cpp

26 lines
587 B
C++
Raw Normal View History

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.
2009-07-09 03:51:30 +00:00
#include <boost/exception/all.hpp>
2008-03-04 01:41:17 +00:00
#include <iostream>
void f(); //throws unknown types that derive from boost::exception.
void
g()
{
2008-03-04 01:41:17 +00:00
try
{
2008-03-04 01:41:17 +00:00
f();
}
2008-03-04 01:41:17 +00:00
catch(
boost::exception & e )
{
std::cerr << diagnostic_information(e);
}
}