NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
extended-error-message.hpp
Go to the documentation of this file.
1
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
26
#ifndef NFD_CORE_EXTENDED_ERROR_MESSAGE_HPP
27
#define NFD_CORE_EXTENDED_ERROR_MESSAGE_HPP
28
29
#include <boost/exception/get_error_info.hpp>
30
#include <sstream>
31
32
namespace
nfd
{
33
34
template
<
typename
E>
35
std::string
36
getExtendedErrorMessage
(
const
E& exception)
37
{
38
std::ostringstream errorMessage;
39
errorMessage << exception.what();
40
41
const
char
*
const
* file = boost::get_error_info<boost::throw_file>(exception);
42
const
int
* line = boost::get_error_info<boost::throw_line>(exception);
43
const
char
*
const
* func = boost::get_error_info<boost::throw_function>(exception);
44
if
(file && line) {
45
errorMessage <<
" [from "
<< *file <<
":"
<< *line;
46
if
(func) {
47
errorMessage <<
" in "
<< *func;
48
}
49
errorMessage <<
"]"
;
50
}
51
52
return
errorMessage.str();
53
}
54
55
}
// namespace nfd
56
57
#endif // NFD_CORE_EXTENDED_ERROR_MESSAGE_HPP
nfd::getExtendedErrorMessage
std::string getExtendedErrorMessage(const E &exception)
Definition:
extended-error-message.hpp:36
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndnSIM
NFD
core
extended-error-message.hpp
Generated on Sun Feb 24 2019 22:16:07 for ndnSIM by
1.8.15