Commit 328a02b5a3d217c3f314890ce23eff0f2449d758

Authored by Jürgen Knödlseder
1 parent 30acb68c

Adapt code to new GammaLib exceptions (#35)

src/ctskymap/ctskymap.cpp
@@ -818,8 +818,8 @@ void ctskymap::fill_maps(void) @@ -818,8 +818,8 @@ void ctskymap::fill_maps(void)
818 * 818 *
819 * @param[in] obs CTA observation. 819 * @param[in] obs CTA observation.
820 * 820 *
821 - * @exception GException::no_list  
822 - * No event list found in observation. 821 + * @exception GException::invalid_value
  822 + * Observation does not contain an event list.
823 * 823 *
824 * Fills the events found in a CTA events list into a sky map. The method 824 * Fills the events found in a CTA events list into a sky map. The method
825 * adds the events to the m_counts member. 825 * adds the events to the m_counts member.
@@ -833,7 +833,10 @@ void ctskymap::fill_maps_counts(GCTAObservation* obs) @@ -833,7 +833,10 @@ void ctskymap::fill_maps_counts(GCTAObservation* obs)
833 // Make sure that the observation holds a CTA event list. If this 833 // Make sure that the observation holds a CTA event list. If this
834 // is not the case then throw an exception. 834 // is not the case then throw an exception.
835 if (events == NULL) { 835 if (events == NULL) {
836 - throw GException::no_list(G_FILL_MAPS_COUNTS); 836 + std::string msg = "Specified observation does not contain a CTA event "
  837 + "list. Please specify a CTA observation containing "
  838 + "a CTA event list as argument.";
  839 + throw GException::invalid_value(G_FILL_MAPS_COUNTS, msg);
837 } 840 }
838 841
839 // Setup energy range covered by data 842 // Setup energy range covered by data
test/test_ctprob.py
@@ -159,7 +159,7 @@ class Test(test): @@ -159,7 +159,7 @@ class Test(test):
159 try: 159 try:
160 prob.execute() 160 prob.execute()
161 self.test_try_failure('Exception not thrown') 161 self.test_try_failure('Exception not thrown')
162 - except RuntimeError: 162 + except IOError:
163 self.test_try_success() 163 self.test_try_success()
164 164
165 # Setup ctprob with a list of observations and test prefix 165 # Setup ctprob with a list of observations and test prefix