adamdebreceni commented on code in PR #1504:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1504#discussion_r1113076289


##########
extensions/lua/LuaScriptException.h:
##########
@@ -15,23 +15,26 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+#pragma once
 
-#include <memory>
+#include <exception>
 #include <utility>
 #include <string>
+#include <stdexcept>
 
-#include "PyOutputStream.h"
+namespace org::apache::nifi::minifi::extensions::lua {
 
-#include "utils/gsl.h"
+class LuaScriptException : public std::exception {
+ public:
+  explicit LuaScriptException(std::string error) : error_(std::move(error)) {}
 
-namespace org::apache::nifi::minifi::python {
+  virtual ~LuaScriptException() noexcept = default;
 
-PyOutputStream::PyOutputStream(std::shared_ptr<io::OutputStream> stream)
-    : stream_(std::move(stream)) {
-}
+  virtual const char * what() const noexcept {
+    return error_.c_str();
+  }

Review Comment:
   as far as I know, an copying an `std::exception` must not throw, and 
`std::string` does not guarantee that, I think it would be safer to inherit 
from `std::runtime_error` which does some reference counting in the background



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to