Taskflow
2.4-master-branch
error.hpp
1
#pragma once
2
3
#include <iostream>
4
#include <sstream>
5
#include <exception>
6
7
#include "../utility/stringify.hpp"
8
9
namespace
tf
{
10
11
// Procedure: throw_se
12
// Throws the system error under a given error code.
13
template
<
typename
... ArgsT>
14
//void throw_se(const char* fname, const size_t line, Error::Code c, ArgsT&&... args) {
15
void
throw_re(
const
char
* fname,
const
size_t
line, ArgsT&&... args) {
16
std::ostringstream
oss;
17
oss <<
"["
<< fname <<
":"
<< line <<
"] "
;
18
ostreamize(oss, std::forward<ArgsT>(args)...);
19
//(oss << ... << args);
20
throw
std::runtime_error
(oss.str());
21
}
22
23
}
// ------------------------------------------------------------------------
24
25
#define TF_THROW(...) tf::throw_re(__FILE__, __LINE__, __VA_ARGS__);
26
tf
Definition:
error.hpp:9
std::ostringstream
std::runtime_error
taskflow
core
error.hpp
Generated by
1.8.14