Sirius  0.0.0
exception.h
Go to the documentation of this file.
1 
22 #ifndef SIRIUS_GDAL_EXCEPTION_H_
23 #define SIRIUS_GDAL_EXCEPTION_H_
24 
25 #include <string>
26 
27 #include <cpl_error.h>
28 
29 #include <sirius/exception.h>
30 
31 namespace sirius {
32 namespace gdal {
33 
37 class Exception : public sirius::Exception {
38  public:
43  Exception();
44 
45  Exception(CPLErr level, CPLErrorNum code);
46 
47  Exception(const Exception&) = default;
48  Exception& operator=(const Exception&) = default;
49  Exception(Exception&&) = default;
50  Exception& operator=(Exception&&) = default;
51 
52  const char* what() const noexcept override;
53 
54  private:
55  ::CPLErr err_level_;
56  ::CPLErrorNum err_code_;
57  std::string default_err_msg_;
58 };
59 
60 } // namespace gdal
61 } // namespace sirius
62 
63 #endif // SIRIUS_GDAL_EXCEPTION_H_
Base class for sirius exceptions.
Definition: exception.h:32
Definition: exception.h:27
Exception & operator=(const Exception &)=default
Exception()
Automatically extract GDAL error level and code from last GDAL error.
const char * what() const noexcept override
Exception wrapper for GDAL error.
Definition: exception.h:37