| 69 | public: |
| 70 | explicit PanicError(const std::string& msg) : runtime_error(msg), message_(msg) {} |
| 71 | [[nodiscard]] auto root_cause() const -> std::string_view { |
| 72 | const auto str = std::string_view{message_}; |
| 73 | const auto pos = str.find(": "); |
| 74 | return pos == std::string_view::npos ? str : str.substr(pos + 2); |
| 75 | } |
| 76 | |
| 77 | private: |
| 78 | std::string message_; |