summaryrefslogtreecommitdiff
path: root/v4l2++/src/helpers.cpp
blob: db8040838a79a87204904968a818a328734e65eb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include <v4l2++/helpers.h>

void __my_throw(const char* file, int line, const char *funcname, const char *cond, fmt::string_view format, fmt::format_args args)
{
	std::string str = fmt::vformat(format, args);

	fmt::print(stderr, "{}:{}: {}:\n{}", file, line, funcname, str);
	if (cond)
		fmt::print(stderr, " ({})\n", cond);
	else
		fmt::print("\n");

	fflush(stderr);

	throw std::runtime_error(str);
}