/* * This source code is released into the public domain. */ /* * Exceptions thrown when we fail to create an exec object. The exec() itself * never throws, since it usually runs in a child process; instead, it just * prints a message to stderr and exits. */ #ifndef LFJAIL_EXEC_ERROR_HH #define LFJAIL_EXEC_ERROR_HH #include "generic_error.hh" namespace lfjail { /* * Generic error, what() should be descriptive. */ struct exec_error : generic_error { template exec_error(std::format_string fmt, Args &&...args) : generic_error(fmt, std::forward(args)...) {} }; /* * We tried to execute a path or filename and the file was not found. */ struct executable_not_found : exec_error { std::string executable; executable_not_found(std::string executable_) : exec_error("{}: command not found", executable_) , executable(std::move(executable_)) {} }; } // namespace lfjail #endif // !LFJAIL_EXEC_ERROR_HH