38#ifndef _RaspiCam__Exceptions_h
39#define _RaspiCam__Exceptions_h
73 Exception(
int _code,
const std::string& _err,
const std::string& _func,
const std::string& _file,
int _line)
83 virtual const char *
what()
const throw() {
88 if (
func.size() > 0 )
89 msg = format(
"%s:%d: error: (%d) %s in function %s\n",
file.c_str(),
line,
code,
err.c_str(),
func.c_str());
103 std::string format(
const char* fmt, ... )
107 va_start( args, fmt );
108 vsprintf( buf, fmt, args );
109 return std::string(buf);
Exception(int _code, const std::string &_err, const std::string &_func, const std::string &_file, int _line)
std::string func
function name. Available only when the compiler supports func macro
std::string file
source file name where the error has occured
std::string err
error description
std::string msg
the formatted error message
int line
line number in the source file where the error has occured
virtual const char * what() const