Chisei v1.0
Lightweight AI/ML Framework
Loading...
Searching...
No Matches
model_loader_exception.hpp
Go to the documentation of this file.
1/*
2 *
3 * Copyright 2025 Nathanne Isip
4 *
5 * Redistribution and use in source and binary forms,
6 * with or without modification, are permitted provided
7 * that the following conditions are met:
8 *
9 * 1. Redistributions of source code must retain the
10 * above copyright notice, this list of conditions
11 * and the following disclaimer.
12 *
13 * 2. Redistributions in binary form must reproduce
14 * the above copyright notice, this list of conditions
15 * and the following disclaimer in the documentation
16 * and/or other materials provided with the distribution.
17 *
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
19 * CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES,
20 * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
21 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
23 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
25 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
29 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
31 * DAMAGE.
32 *
33 */
34
40#ifndef CHISEI_MODEL_LOADER_EXCEPTION_HPP
41#define CHISEI_MODEL_LOADER_EXCEPTION_HPP
42
43#include <exception>
44#include <string>
45
54class ModelLoaderException final : public std::exception {
55private:
59 std::string message;
60
61public:
67 ModelLoaderException(std::string _message) :
68 message(_message) { }
69
75 char* what() {
76 return const_cast<char*>(this->message.c_str());
77 }
78};
79
80#endif
Exception class for errors encountered during model loading.
ModelLoaderException(std::string _message)
Constructs a ModelLoaderException with a given error message.
char * what()
Retrieves the error message associated with the exception.