forked from AcademySoftwareFoundation/MaterialX
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathException.h
More file actions
55 lines (42 loc) · 962 Bytes
/
Exception.h
File metadata and controls
55 lines (42 loc) · 962 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// TM & (c) 2021 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
// All rights reserved. See LICENSE.txt for license.
//
#ifndef MATERIALX_EXCEPTION_H
#define MATERIALX_EXCEPTION_H
#include <MaterialXCore/Export.h>
#include <exception>
/// @file
/// Base exception classes
MATERIALX_NAMESPACE_BEGIN
/// @class Exception
/// The base class for exceptions that are propagated from the MaterialX library
/// to the client application.
class MX_CORE_API Exception : public std::exception
{
public:
explicit Exception(const string& msg) :
_msg(msg)
{
}
Exception(const Exception& e) :
_msg(e._msg)
{
}
Exception& operator=(const Exception& e)
{
_msg = e._msg;
return *this;
}
virtual ~Exception() noexcept
{
}
const char* what() const noexcept override
{
return _msg.c_str();
}
private:
string _msg;
};
MATERIALX_NAMESPACE_END
#endif