Loading [MathJax]/extensions/tex2jax.js
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exceptions.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2024-2025, NVIDIA CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 #pragma once
17 #include <exception>
18 #include <string>
19 
20 namespace ML {
21 namespace experimental {
22 namespace forest {
23 struct traversal_exception : std::exception {
24  traversal_exception() : msg_{"Error encountered while traversing forest"} {}
25  traversal_exception(std::string msg) : msg_{msg} {}
26  traversal_exception(char const* msg) : msg_{msg} {}
27  virtual char const* what() const noexcept { return msg_.c_str(); }
28 
29  private:
30  std::string msg_;
31 };
32 } // namespace forest
33 } // namespace experimental
34 } // namespace ML
Definition: dbscan.hpp:30
traversal_exception(std::string msg)
Definition: exceptions.hpp:25
traversal_exception(char const *msg)
Definition: exceptions.hpp:26
virtual char const * what() const noexcept
Definition: exceptions.hpp:27
traversal_exception()
Definition: exceptions.hpp:24