icedb  version 0.5.1
Snow particle scattering database API
Classes | Namespaces | Macros | Typedefs | Functions
error.hpp File Reference
#include "defs.h"
#include <exception>
#include <memory>
#include <string>
#include "optionsForwards.hpp"
#include "errorTypes.hpp"
#include "error.h"
Include dependency graph for error.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  icedb::error::xError
 

Namespaces

 icedb
 
 icedb::error
 

Macros

#define ICEDB_RSpushErrorvars
 
#define ICEDB_RSmkError(x)
 
#define ICEDB_throw(x)   throw ICEDB_RSmkError(x)
 

Typedefs

typedef std::shared_ptr< xError > icedb::error::xError_ptr
 
typedef ICEDB_error_code icedb::error::error_code_t
 
typedef std::shared_ptr< ICEDB_error_contexticedb::error::error_context_pt
 

Functions

DL_ICEDB void icedb::error::stringify (error_code_t err, std::string &res)
 
DL_ICEDB void icedb::error::stringify (error_code_t err, const char **res)
 
template<class StringType >
StringType icedb::error::stringify (error_code_t err)
 
template<>
DL_ICEDB std::string icedb::error::stringify (error_code_t err)
 
template<>
DL_ICEDB const char * icedb::error::stringify (error_code_t err)
 
DL_ICEDB error_context_pt icedb::error::get_error_context_thread_local ()
 
DL_ICEDB error_code_t icedb::error::error_context_to_code (const error_context_pt &err)
 
DL_ICEDB void icedb::error::stringify (const error_context_pt &err, std::string &res)
 
DL_ICEDB std::string icedb::error::stringify (const error_context_pt &err)
 

Macro Definition Documentation

◆ ICEDB_RSmkError

#define ICEDB_RSmkError (   x)
Value:
ICEDB_RSpushErrorvars
xError & push(::icedb::registry::options_ptr)
Insert a context of Errors.
Definition: error.cpp:257

Definition at line 82 of file error.hpp.

◆ ICEDB_RSpushErrorvars

#define ICEDB_RSpushErrorvars
Value:
.add<std::string>("source_filename", std::string(__FILE__)) \
.add<int>("source_line", (int)__LINE__) \
.add<std::string>("source_function", std::string(ICEDB_FUNCSIG))

Definition at line 78 of file error.hpp.

◆ ICEDB_throw

#define ICEDB_throw (   x)    throw ICEDB_RSmkError(x)
Todo:
Detect if inherits from std::exception or not. If inheritable, check if it is an xError. If yes, push a new context. If not inheritable, push a new context with what() as the expression. If not an exception, then create a new xError and push the appropriate type in a context.

Definition at line 88 of file error.hpp.

Referenced by icedb::registry::options::add(), icedb::Examples::Shapes::ScopedHandles::CloseHDF5File::Close(), icedb::Examples::Shapes::ScopedHandles::CloseHDF5Dataset::Close(), icedb::Examples::Shapes::ScopedHandles::CloseHDF5Dataspace::Close(), icedb::Examples::Shapes::ScopedHandles::CloseHDF5Datatype::Close(), icedb::units::converter::convert(), icedb::refract::enumProvider(), icedb::refract::enumProviders(), icedb::splitSet::extractInterval(), icedb::refract::findProvider(), icedb::refract::findProviders(), icedb::zeros::findzero(), main(), icedb::Examples::Shapes::MatchType(), icedb::refract::implementations::mDustHanel(), icedb::refract::implementations::mIceHanel(), icedb::refract::implementations::mIceMatzler(), icedb::refract::implementations::mIceWarren(), icedb::refract::implementations::mNaClHanel(), icedb::refract::implementations::mSandEHanel(), icedb::refract::implementations::mSandOHanel(), icedb::refract::implementations::mSeaSaltHanel(), icedb::refract::implementations::mWaterFreshMeissnerWentz(), icedb::refract::implementations::mWaterHanel(), icedb::refract::implementations::mWaterLiebe(), icedb::refract::prepRefract(), icedb::Examples::Shapes::readDataset(), icedb::Examples::Shapes::readPSUfile(), icedb::zeros::secantMethod(), anonymous_namespace{refractImpl.cpp}::setupHanelA(), anonymous_namespace{refractImpl.cpp}::setupHanelB(), and icedb::splitSet::splitSet().