Skip to content

Commit

Permalink
fix unitialized variables in an EMCAL exception
Browse files Browse the repository at this point in the history
Now giving proper error log when the exception occurs
  • Loading branch information
sawenzel committed Nov 21, 2018
1 parent 487e3e0 commit 6c1ff65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Detectors/EMCAL/base/include/EMCALBase/GeometryBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class InvalidModuleException : public std::exception
class InvalidPositionException : public std::exception
{
public:
InvalidPositionException(double eta, double phi) : std::exception()
InvalidPositionException(double eta, double phi) : std::exception(), mEta(eta), mPhi(phi)
{
std::stringstream msgbuilder;
msgbuilder << "Position phi (" << mPhi << "), eta(" << mEta << ") not im EMCAL";
Expand All @@ -81,7 +81,8 @@ class InvalidPositionException : public std::exception
const char* what() const noexcept final { return mMessage.c_str(); }

private:
double mEta, mPhi; ///< Position (eta, phi) raising the exception
double mEta = 0.;
double mPhi = 0.; ///< Position (eta, phi) raising the exception
std::string mMessage; ///< Error message
};

Expand Down

0 comments on commit 6c1ff65

Please sign in to comment.