blob: 7b07537ce63e804a512d9c2a58721b75348534bd (
plain) (
blame)
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
|
#include "matcherexception.h"
#include "config.h"
#include "ruststring.h"
#include "strprintf.h"
namespace newsboat {
const char* MatcherException::what() const throw()
{
static std::string errmsg;
switch (type_) {
case Type::ATTRIB_UNAVAIL:
errmsg = strprintf::fmt(
_("attribute `%s' is not available."), addinfo);
break;
case Type::INVALID_REGEX:
errmsg = strprintf::fmt(
_("regular expression '%s' is invalid: %s"),
addinfo,
addinfo2);
break;
}
return errmsg.c_str();
}
MatcherException MatcherException::from_rust_error(MatcherErrorFfi error)
{
const std::string info_ = RustString(error.info);
const std::string info2_ = RustString(error.info2);
return MatcherException(error.type, info_, info2_);
}
} // namespace newsboat
|