refactor: improve error handling
This commit is contained in:
parent
47a2d0a64d
commit
e4f4316305
6
src/ro.h
6
src/ro.h
@ -41,9 +41,9 @@ namespace ro
|
|||||||
return std::string(l.what()) == std::string(r.what());
|
return std::string(l.what()) == std::string(r.what());
|
||||||
}
|
}
|
||||||
|
|
||||||
inline Error operator+(const Error &other)
|
friend inline Error operator+(const Error & l, const Error &r)
|
||||||
{
|
{
|
||||||
return Error(std::string(this->what()) + "\n" + other.what());
|
return Error(std::string(l.what()) + "\n" + r.what());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -346,7 +346,7 @@ namespace ro
|
|||||||
throw m_result;
|
throw m_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const T &expect(E e) const
|
inline const T &expect(const E& e) const
|
||||||
{
|
{
|
||||||
if (is_ok())
|
if (is_ok())
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user