| 3409 | } // namespace detail |
| 3410 | |
| 3411 | class error : public std::runtime_error { |
| 3412 | private: |
| 3413 | // Because VC++ is upsetting, most of the time! |
| 3414 | std::string what_reason; |
| 3415 | |
| 3416 | public: |
| 3417 | error(const std::string& str) : error(detail::direct_error, "lua: error: " + str) { |
| 3418 | } |
| 3419 | error(std::string&& str) : error(detail::direct_error, "lua: error: " + std::move(str)) { |
| 3420 | } |
| 3421 | error(detail::direct_error_tag, const std::string& str) : std::runtime_error(""), what_reason(str) { |
| 3422 | } |
| 3423 | error(detail::direct_error_tag, std::string&& str) : std::runtime_error(""), what_reason(std::move(str)) { |
| 3424 | } |
| 3425 | |
| 3426 | error(const error& e) = default; |
| 3427 | error(error&& e) = default; |
| 3428 | error& operator=(const error& e) = default; |
| 3429 | error& operator=(error&& e) = default; |
| 3430 | |
| 3431 | virtual const char* what() const noexcept override { |
| 3432 | return what_reason.c_str(); |
| 3433 | } |
| 3434 | }; |
| 3435 | |
| 3436 | } // namespace sol |
| 3437 |
no outgoing calls
no test coverage detected