refactor: improve error handling

This commit is contained in:
DL 2024-02-28 15:22:14 +01:00
parent 47a2d0a64d
commit e4f4316305

View File

@ -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())
{