Skip to content

Commit

Permalink
fixup exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
parejkoj committed Feb 13, 2024
1 parent e036d66 commit 69c20a2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/KernelCandidate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @ingroup ip_diffim
*/

#include <stdexcept>
#include "boost/timer.hpp"

#include "lsst/afw/math.h"
Expand Down Expand Up @@ -144,7 +144,7 @@ void KernelCandidate<PixelT>::_buildKernelSolution(lsst::afw::math::KernelList c
} else if (conditionNumberType == "EIGENVALUE") {
ctype = KernelSolution::EIGENVALUE;
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "conditionNumberType not recognized");
throw LSST_EXCEPT(pexExcept::TypeError, "conditionNumberType not recognized");
}

/* Do we have a regularization matrix? If so use it */
Expand Down Expand Up @@ -236,7 +236,7 @@ std::shared_ptr<lsst::afw::math::Kernel> KernelCandidate<PixelT>::getKernel(Cand
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get kernel");
throw std::logic_error("Invalid CandidateSwitch, cannot get kernel");
}
}

Expand All @@ -260,7 +260,7 @@ double KernelCandidate<PixelT>::getBackground(CandidateSwitch cand) const {
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get background");
throw std::logic_error("Invalid CandidateSwitch, cannot get background");
}
}

Expand All @@ -284,7 +284,7 @@ double KernelCandidate<PixelT>::getKsum(CandidateSwitch cand) const {
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get kSum");
throw std::logic_error("Invalid CandidateSwitch, cannot get kSum");
}
}

Expand All @@ -309,7 +309,7 @@ std::shared_ptr<typename KernelCandidate<PixelT>::ImageT> KernelCandidate<PixelT
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get kernel image");
throw std::logic_error("Invalid CandidateSwitch, cannot get kernel image");
}
}

Expand Down Expand Up @@ -339,7 +339,7 @@ std::shared_ptr<StaticKernelSolution<PixelT> > KernelCandidate<PixelT>::getKerne
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get solution");
throw std::logic_error("Invalid CandidateSwitch, cannot get solution");
}
}

Expand All @@ -363,7 +363,7 @@ lsst::afw::image::MaskedImage<PixelT> KernelCandidate<PixelT>::getDifferenceImag
else
throw LSST_EXCEPT(pexExcept::RuntimeError, "No kernels exist");
} else {
throw LSST_EXCEPT(pexExcept::RuntimeError, "Invalid CandidateSwitch, cannot get diffim");
throw std::logic_error("Invalid CandidateSwitch, cannot get diffim");
}
}

Expand Down

0 comments on commit 69c20a2

Please sign in to comment.