exceptions.hpp
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2024-2025, NVIDIA CORPORATION.
3  * SPDX-License-Identifier: Apache-2.0
4  */
5 #pragma once
6 #include <exception>
7 #include <string>
8 
9 namespace ML {
10 namespace forest {
11 struct traversal_exception : std::exception {
12  traversal_exception() : msg_{"Error encountered while traversing forest"} {}
13  traversal_exception(std::string msg) : msg_{msg} {}
14  traversal_exception(char const* msg) : msg_{msg} {}
15  virtual char const* what() const noexcept { return msg_.c_str(); }
16 
17  private:
18  std::string msg_;
19 };
20 } // namespace forest
21 } // namespace ML
Definition: dbscan.hpp:18
Definition: exceptions.hpp:11
traversal_exception(char const *msg)
Definition: exceptions.hpp:14
virtual char const * what() const noexcept
Definition: exceptions.hpp:15
traversal_exception()
Definition: exceptions.hpp:12
traversal_exception(std::string msg)
Definition: exceptions.hpp:13