OmniSciDB  2e3a973ef4
import_export::anonymous_namespace{GDAL.cpp} Namespace Reference

Functions

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

Function Documentation

◆ gdal_error_handler()

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

Definition at line 32 of file GDAL.cpp.

References CHECK, logger::INFO, import_export::GDAL::init_mutex_, import_export::GDAL::initialized_, LOG, and to_string().

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

32  {
33  CHECK(err_class >= CE_None && err_class <= CE_Fatal);
34  static constexpr std::array<const char*, 5> err_class_strings{
35  "Info",
36  "Debug",
37  "Warning",
38  "Failure",
39  "Fatal",
40  };
41  std::string log_msg = std::string("GDAL ") + err_class_strings[err_class] + ": " +
42  err_msg + " (" + std::to_string(err_no) + ")";
43  if (err_class >= CE_Failure) {
44  throw std::runtime_error(log_msg);
45  } else {
46  LOG(INFO) << log_msg;
47  }
48 }
#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: