Files
pymol-open-source/layer0/Error.cpp
2025-09-26 12:07:31 -04:00

24 lines
369 B
C++

#include "Error.h"
#include <sstream>
namespace pymol
{
const std::string& Error::what() const noexcept
{
if (m_isCached) {
return m_cachedErrMsg;
}
if (m_formatter) {
std::ostringstream stream;
m_formatter(stream); // Execute the lambda
m_cachedErrMsg = stream.str();
}
m_isCached = true;
return m_cachedErrMsg;
}
} // namespace pymol