NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: 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
31
namespace
nfd
{
32
33
template
<
typename
E>
34
std::string
35
getExtendedErrorMessage
(
const
E& exception)
36
{
37
std::ostringstream errorMessage;
38
errorMessage << exception.what();
39
40
const
char
*
const
*
file
= boost::get_error_info<boost::throw_file>(exception);
41
const
int
* line = boost::get_error_info<boost::throw_line>(exception);
42
const
char
*
const
* func = boost::get_error_info<boost::throw_function>(exception);
43
if
(file && line) {
44
errorMessage <<
" [from "
<< *file <<
":"
<< *line;
45
if
(func) {
46
errorMessage <<
" in "
<< *func;
47
}
48
errorMessage <<
"]"
;
49
}
50
51
return
errorMessage.str();
52
}
53
54
}
// namespace nfd
55
56
#endif // NFD_CORE_EXTENDED_ERROR_MESSAGE_HPP
nfd::getExtendedErrorMessage
std::string getExtendedErrorMessage(const E &exception)
Definition:
extended-error-message.hpp:35
nfd
Copyright (c) 2011-2015 Regents of the University of California.
Definition:
ndn-common.hpp:40
ndn::security::file
tpm file
Definition:
key-chain.cpp:70
ndnSIM
NFD
core
extended-error-message.hpp
Generated on Sat Nov 12 2016 16:02:53 for ndnSIM by
1.8.12