Basic exceptions and related helper macros. More...
#include <sstream>
#include <stdexcept>
#include <string>
#include <sbia/tclap/ArgException.h>
Go to the source code of this file.
Classes | |
class | sbia::basis::SubprocessException |
Exception type thrown by execute_process(). More... | |
Defines | |
#define | BASIS_THROW(type, msg) |
Throw exception with given message. | |
Typedefs | |
typedef TCLAP::ArgException | sbia::basis::ArgException |
Exception thrown by command-line parsing library. | |
typedef TCLAP::ArgParseException | sbia::basis::ArgParseException |
Exception thrown on command-line argument parsing error. | |
typedef TCLAP::SpecificationException | sbia::basis::CmdLineException |
Exception thrown when command-line specification is wrong. | |
typedef TCLAP::CmdLineParseException | sbia::basis::CmdLineParseException |
Exception thrown on command-line parsing error. | |
typedef TCLAP::ExitException | sbia::basis::ExitException |
Exception thrown by command-line parsing library to indicate that program should exit with the given exit code. |
Basic exceptions and related helper macros.
Copyright (c) 2011 University of Pennsylvania. All rights reserved.
See https://www.cbica.upenn.edu/sbia/software/license.html or COPYING file.
Contact: SBIA Group <sbia-software at uphs.upenn.edu>
Definition in file except.h.
#define BASIS_THROW | ( | type, | |
msg | |||
) |
{ \ ::std::ostringstream oss; \ oss << msg; \ throw type(oss.str().c_str()); \ }
Throw exception with given message.
Example:
void func(int i) { if (i < 0) BASIS_THROW(std::invalid_argument, "Argument i (= " << i << ") must be positive"); }
[in] | type | The type of the exception. Note that this exception type has to implement a constructor with one std::string as argument, the exception message. |
[in] | msg | The exception message. The given argument is streamed into a std::ostringstream. |