* Defines an exception that may occur within the confines of a script. */
| 35 | * Defines an exception that may occur within the confines of a script. |
| 36 | */ |
| 37 | class ScriptException : public std::exception { |
| 38 | public: |
| 39 | // Constructor |
| 40 | /*! |
| 41 | * Create a new exception |
| 42 | */ |
| 43 | ScriptException(std::string errorMsg) |
| 44 | : error_(std::move(errorMsg)) { |
| 45 | } |
| 46 | |
| 47 | virtual ~ScriptException() noexcept = default; |
| 48 | |
| 49 | virtual const char * what() const noexcept { |
| 50 | return error_.c_str(); |
| 51 | } |
| 52 | |
| 53 | private: |
| 54 | std::string error_; |
| 55 | }; |
| 56 | } /* namespace script */ |
| 57 | } /* namespace minifi */ |
| 58 | } /* namespace nifi */ |