Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#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();
}