X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FBases%2FInterpKernelException.hxx;h=1d6ce7d7c6c346d7a117d7847d46906185b0db83;hb=HEAD;hp=de66a46a04ba671f8a029124d2f874d9e2b72ed2;hpb=8763c12d01e33d6845dd53be65b001514d00bd42;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/Bases/InterpKernelException.hxx b/src/INTERP_KERNEL/Bases/InterpKernelException.hxx index de66a46a0..1d6ce7d7c 100644 --- a/src/INTERP_KERNEL/Bases/InterpKernelException.hxx +++ b/src/INTERP_KERNEL/Bases/InterpKernelException.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -25,6 +25,7 @@ #include #include +#include namespace INTERP_KERNEL { @@ -32,12 +33,19 @@ namespace INTERP_KERNEL { public: INTERPKERNEL_EXPORT Exception(const char *reason); + INTERPKERNEL_EXPORT Exception(const std::string& reason); INTERPKERNEL_EXPORT Exception(const char *reason, const char *file, int line); - INTERPKERNEL_EXPORT ~Exception() throw (); - INTERPKERNEL_EXPORT const char *what() const throw(); + INTERPKERNEL_EXPORT ~Exception() noexcept(true); + INTERPKERNEL_EXPORT const char *what() const noexcept(true); protected: std::string _reason; }; } +#define THROW_IK_EXCEPTION(text) \ +{ \ + std::ostringstream oss; oss << text; \ + throw INTERP_KERNEL::Exception(oss.str()); \ +} + #endif