Commit 9fb9976d70181b2f6165cdf897baa13a7325d1e1

Authored by Jürgen Knödlseder
1 parent adcff468

Use standard exception in events access.

Showing 1 changed file with 7 additions and 6 deletions
src/obs/GObservation.cpp
... ... @@ -754,22 +754,23 @@ void GObservation::events(const GEvents& events)
754 754  
755 755  
756 756 /***********************************************************************//**
757   - * @brief Return event container
  757 + * @brief Return events
758 758 *
759 759 * @exception GException::no_events
760   - * No event container defined for observation.
  760 + * No events allocated for observation.
761 761 *
762   - * Returns pointer to event container.
  762 + * Returns pointer to events.
763 763 ***************************************************************************/
764 764 const GEvents* GObservation::events(void) const
765 765 {
766 766 // Throw an exception if the event container is not valid
767 767 if (m_events == NULL) {
768   - throw GException::no_events(G_EVENTS);
  768 + std::string msg = "No events allocated for observation.";
  769 + throw GException::invalid_value(G_EVENTS, msg);
769 770 }
770 771  
771   - // Return pointer to event container
772   - return m_events;
  772 + // Return pointer to events
  773 + return (m_events);
773 774 }
774 775  
775 776  
... ...