refactor: improve error handling
This commit is contained in:
6
src/ro.h
6
src/ro.h
@ -41,9 +41,9 @@ namespace ro
|
||||
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;
|
||||
}
|
||||
|
||||
inline const T &expect(E e) const
|
||||
inline const T &expect(const E& e) const
|
||||
{
|
||||
if (is_ok())
|
||||
{
|
||||
|
Reference in New Issue
Block a user