1 | #pragma once |
---|---|
2 | |
3 | namespace taichi::lang { |
4 | |
5 | class IRModified {}; |
6 | |
7 | class TaichiExceptionImpl : public std::exception { |
8 | std::string msg_; |
9 | |
10 | public: |
11 | explicit TaichiExceptionImpl(const std::string msg) : msg_(msg) { |
12 | } |
13 | const char *what() const noexcept override { |
14 | return msg_.c_str(); |
15 | } |
16 | }; |
17 | |
18 | class TaichiTypeError : public TaichiExceptionImpl { |
19 | using TaichiExceptionImpl::TaichiExceptionImpl; |
20 | }; |
21 | |
22 | class TaichiSyntaxError : public TaichiExceptionImpl { |
23 | using TaichiExceptionImpl::TaichiExceptionImpl; |
24 | }; |
25 | |
26 | class TaichiIndexError : public TaichiExceptionImpl { |
27 | using TaichiExceptionImpl::TaichiExceptionImpl; |
28 | }; |
29 | |
30 | class TaichiRuntimeError : public TaichiExceptionImpl { |
31 | using TaichiExceptionImpl::TaichiExceptionImpl; |
32 | }; |
33 | |
34 | class TaichiAssertionError : public TaichiExceptionImpl { |
35 | using TaichiExceptionImpl::TaichiExceptionImpl; |
36 | }; |
37 | |
38 | } // namespace taichi::lang |
39 |