1 #ifndef vil_exception_h_ 2 #define vil_exception_h_ 3 #define VXL_LEGACY_ERROR_REPORTING // REQUIRED FOR PASSING TESTS 2018-11-02 13 # include <vcl_msvc_warnings.h> 25 #if !defined VXL_LEGACY_ERROR_REPORTING 28 std::cerr <<
"\nERROR: " << exception.what() << std::endl;
39 #if !defined VXL_LEGACY_ERROR_REPORTING 42 std::cerr <<
"\nWARNING: " << exception.what() << std::endl;
48 :
public std::logic_error
55 std::logic_error(operation +
": Pixel formats incompatible."),
63 : public std::logic_error
70 std::logic_error(operation +
": Unsupported pixel format."),
82 : public std::logic_error
87 const std::string& operation) :
88 std::logic_error(operation +
": Pixel access out-of-bounds."),
100 : public std::logic_error
105 const std::string& operation) :
106 std::logic_error(operation +
": Unsupported operation."),
114 : public std::runtime_error
119 const std::string& type,
120 const std::string& file_name,
121 const std::string& description =
"") :
123 (
"Failed to load " + file_name +
" in " 124 + function +
" using " + type +
" loader. " + description),
125 function_name(function), file_type(type), filename(file_name), details(description) {}
142 const std::string& type,
143 const std::string& file_name,
144 const std::string& description =
"")
159 const std::string& type,
160 const std::string& file_name,
161 const std::string& description =
"")
167 #endif // vil_exception_h_
vil_exception_corrupt_image_file(const std::string &function, const std::string &type, const std::string &file_name, const std::string &description="")
vil_exception_image_io(const std::string &function, const std::string &type, const std::string &file_name, const std::string &description="")
Indicates that some operation is not supported.
std::string operation_name
vil_exception_invalid_version(const std::string &function, const std::string &type, const std::string &file_name, const std::string &description="")
Indicates that an image load or save operation failed.
Indicating an object with an unknown version number.
Indicates that some reference was made to pixels beyond the bounds of an image.
Indicates unexpected problems image file's data.
std::string function_name
std::string operation_name
vil_exception_out_of_bounds(const std::string &operation)
void vil_exception_warning(T exception)
Throw an exception indicating a potential problem.
void vil_exception_error(T exception)
Throw an exception indicating a definite problem.
vil_exception_unsupported_operation(const std::string &operation)