OmniSciDB  340b00dbf6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Geospatial::anonymous_namespace{GDAL.cpp} Namespace Reference

Functions

void gdal_error_handler (CPLErr err_class, int err_no, const char *err_msg)
 

Function Documentation

void Geospatial::anonymous_namespace{GDAL.cpp}::gdal_error_handler ( CPLErr  err_class,
int  err_no,
const char *  err_msg 
)

Definition at line 35 of file GDAL.cpp.

References CHECK, logger::INFO, LOG, and to_string().

Referenced by Geospatial::GDAL::init().

35  {
36  CHECK(err_class >= CE_None && err_class <= CE_Fatal);
37  static constexpr std::array<const char*, 5> err_class_strings{
38  "Info",
39  "Debug",
40  "Warning",
41  "Failure",
42  "Fatal",
43  };
44  std::string log_msg = std::string("GDAL ") + err_class_strings[err_class] + ": " +
45  err_msg + " (" + std::to_string(err_no) + ")";
46  if (err_class >= CE_Failure) {
47  throw std::runtime_error(log_msg);
48  } else {
49  LOG(INFO) << log_msg;
50  }
51 }
#define LOG(tag)
Definition: Logger.h:188
std::string to_string(char const *&&v)
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the call graph for this function:

+ Here is the caller graph for this function: