From 6a109aca9bae0b858099f59d084a0254841397ac Mon Sep 17 00:00:00 2001 From: Simon Julier Date: Fri, 20 Jan 2017 01:58:59 +0000 Subject: [PATCH] Throw an exception rather than call exit. --- wrap/Argument.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wrap/Argument.cpp b/wrap/Argument.cpp index 6badf7794..01da3a756 100644 --- a/wrap/Argument.cpp +++ b/wrap/Argument.cpp @@ -79,8 +79,7 @@ void Argument::matlab_unwrap(FileWriter& file, const string& matlabName) const { // We cannot handle scalar non const references if (!isNotScalar && is_ref && !is_const) { - cerr << "Cannot wrap a scalar non-const reference" << endl; - exit(-1); + throw std::runtime_error("Cannot unwrap a scalar non-const reference"); } if (is_ptr && type.category != Qualified::EIGEN)