/* * This source code is released into the public domain. */ #ifndef LFJAIL_IO_ERROR_HH #define LFJAIL_IO_ERROR_HH #include #include #include #include "generic_error.hh" namespace lfjail { struct io_error final : generic_error { std::string path; std::error_code error; io_error(std::string path_, std::error_code error_) : generic_error("{0}: {1}", path_, error_.message()) , path(std::move(path_)) , error(error_) {} io_error(std::string path_, int error_) : io_error(std::move(path_), make_error_code(static_cast(error_))) {} }; } // namespace lfjail #endif // LFJAIL_IO_ERROR_HH