Improve error handling and reporting in the LED pattern parser
[led-pattern-ed] / src / led-pattern.vala
index 4f9b196..fe3446c 100644 (file)
  * along with LED Pattern Editor. If not, see <http://www.gnu.org/licenses/>.
  */
 
+errordomain LedPatternError {
+       INVALID_PATTERN;
+}
+
 abstract class LedPattern : Object {
        enum ScreenOn {
                DISPLAY_OFF = 0,
@@ -34,7 +38,7 @@ abstract class LedPattern : Object {
        public double duration;
 
        public abstract string dump ();
-       public abstract bool parse (string line);
+       public abstract void parse (string line) throws LedPatternError;
 
        public signal void changed ();
 }