Public Member Functions | Private Attributes | List of all members
art::SQLErrMsg Class Reference

#include <SQLErrMsg.h>

Public Member Functions

 SQLErrMsg ()
 
 ~SQLErrMsg ()
 
std::string msg () const
 
void throwIfError ()
 
void reset ()
 
 operator char ** ()
 

Private Attributes

char * errMsg_
 

Detailed Description

Definition at line 15 of file SQLErrMsg.h.

Constructor & Destructor Documentation

art::SQLErrMsg::SQLErrMsg ( )
inline

Definition at line 17 of file SQLErrMsg.h.

17 : errMsg_(nullptr) {}
char * errMsg_
Definition: SQLErrMsg.h:43
art::SQLErrMsg::~SQLErrMsg ( )

Definition at line 27 of file SQLErrMsg.cc.

28 {
29  reset();
30 }
void reset()
Definition: SQLErrMsg.cc:21

Member Function Documentation

std::string art::SQLErrMsg::msg ( ) const
inline

Definition at line 22 of file SQLErrMsg.h.

23  {
24  return errMsg_;
25  }
char * errMsg_
Definition: SQLErrMsg.h:43
art::SQLErrMsg::operator char ** ( )
inline

Definition at line 36 of file SQLErrMsg.h.

37  {
38  reset();
39  return &errMsg_;
40  }
void reset()
Definition: SQLErrMsg.cc:21
char * errMsg_
Definition: SQLErrMsg.h:43
void art::SQLErrMsg::reset ( )

Definition at line 21 of file SQLErrMsg.cc.

22 {
23  sqlite3_free(errMsg_);
24  errMsg_ = 0;
25 }
char * errMsg_
Definition: SQLErrMsg.h:43
void art::SQLErrMsg::throwIfError ( )

Definition at line 10 of file SQLErrMsg.cc.

11 {
12  if (errMsg_) {
14  reset();
15  throw Exception(errors::SQLExecutionError, "SQLite3Wrapper::exec")
16  << "Error executing SQL: " << msg << "\n";
17  }
18 }
std::string string
Definition: nybbler.cc:12
void reset()
Definition: SQLErrMsg.cc:21
char * errMsg_
Definition: SQLErrMsg.h:43
std::string msg() const
Definition: SQLErrMsg.h:22
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66

Member Data Documentation

char* art::SQLErrMsg::errMsg_
private

Definition at line 43 of file SQLErrMsg.h.


The documentation for this class was generated from the following files: