BASIS  version 1.2.3 (revision 2104)
Classes | Defines | Typedefs
except.h File Reference

Basic exceptions and related helper macros. More...

#include <sstream>
#include <stdexcept>
#include <string>
#include <sbia/tclap/ArgException.h>
+ Include dependency graph for except.h:
+ This graph shows which files directly or indirectly include this file:

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.

Detailed Description

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 Documentation

#define BASIS_THROW (   type,
  msg 
)
Value:
{ \
       ::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");
 }
Parameters:
[in]typeThe type of the exception. Note that this exception type has to implement a constructor with one std::string as argument, the exception message.
[in]msgThe exception message. The given argument is streamed into a std::ostringstream.

Definition at line 50 of file except.h.