LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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.

References ~SQLErrMsg().

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

Definition at line 27 of file SQLErrMsg.cc.

References reset().

Referenced by SQLErrMsg().

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.

References errMsg_, reset(), and throwIfError().

Referenced by throwIfError().

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

Definition at line 36 of file SQLErrMsg.h.

References errMsg_, and reset().

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

Definition at line 21 of file SQLErrMsg.cc.

References errMsg_.

Referenced by msg(), operator char **(), throwIfError(), and ~SQLErrMsg().

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.

References errMsg_, msg(), reset(), and art::errors::SQLExecutionError.

Referenced by util::FileCatalogMetadataExtras::addPerFileMetadata(), and msg().

11 {
12  if (errMsg_) {
13  std::string msg(errMsg_);
14  reset();
15  throw Exception(errors::SQLExecutionError, "SQLite3Wrapper::exec")
16  << "Error executing SQL: " << msg << "\n";
17  }
18 }
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.

Referenced by msg(), operator char **(), reset(), and throwIfError().


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