STIR
6.4.0
STIR
src
include
stir
error.h
Go to the documentation of this file.
1
//
2
//
3
#ifndef __stir_error_H__
4
#define __stir_error_H__
5
/*
6
Copyright (C) 2000 PARAPET partners
7
Copyright (C) 2000 - 2010-06-25, Hammersmith Imanet Ltd
8
Copyright (C) 2013-01-01 - 2013, Kris Thielemans
9
This file is part of STIR.
10
SPDX-License-Identifier: Apache-2.0 AND License-ref-PARAPET-license
11
12
See STIR/LICENSE.txt for details
13
*/
22
#include "
stir/common.h
"
23
#include <iostream>
24
#include <sstream>
25
26
#include "TextWriter.h"
27
28
START_NAMESPACE_STIR
29
31
49
void
error(
const
char
*
const
s, ...);
50
52
71
72
template
<
class
STRING>
73
inline
void
74
error
(
const
STRING&
string
)
75
{
76
std::stringstream sstr;
77
sstr <<
"\nERROR: "
<<
string
<< std::endl;
78
writeText(sstr.str().c_str(), ERROR_CHANNEL);
79
throw
std::runtime_error(sstr.str());
80
}
81
82
END_NAMESPACE_STIR
83
#endif
common.h
basic configuration include file
stir::error
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition
error.cxx:42
Generated on Wed May 27 2026 17:04:05 for STIR by
1.13.2