#include <libwccl/exception.h> #include <sstream> namespace Wccl { WcclError::WcclError(const std::string &what) : PwrNlp::PwrNlpError(what) { } WcclError::~WcclError() throw() { } std::string WcclError::scope() const { return "Wccl"; } FileNotFound::FileNotFound(const std::string& filename, const std::string& paths, const std::string& where) : WcclError("File not found: " + filename), filename(filename), paths(paths), where(where) { } FileNotFound::~FileNotFound() throw() { } std::string FileNotFound::info() const { std::ostringstream ss; if (where.empty()) { ss << "File "; } else { ss << where << " file "; } ss << "'" << filename << "' not found in search path " << paths; return ss.str(); } InvalidArgument::InvalidArgument(const std::string &arg_name, const std::string &reason) : WcclError(reason), arg_name(arg_name), reason(reason) { } InvalidArgument::~InvalidArgument() throw() { } std::string InvalidArgument::info() const { std::ostringstream ss; ss << "Invalid argument " << arg_name << " : " << reason; return ss.str(); } } /* end ns Wccl */