JS watcher does not die when the compilation failed
authorFrederic Massart <fred@moodle.com>
Fri, 1 Aug 2014 07:05:23 +0000 (15:05 +0800)
committerFrederic Massart <fred@moodle.com>
Fri, 1 Aug 2014 07:05:23 +0000 (15:05 +0800)
mdk/commands/js.py

index 67b891a..34ee99b 100644 (file)
@@ -180,5 +180,8 @@ class JsShiftWatcher(watchdog.events.FileSystemEventHandler):
             return
 
         logging.info('[%s] (%s) Changes detected!' % (self._M.get('identifier'), datetime.datetime.now().strftime('%H:%M:%S')))
-        # How about handling exceptions here?
-        self._processor.shift(**self._args)
+
+        try:
+            self._processor.shift(**self._args)
+        except js.ShifterCompileFailed:
+            logging.error(' /!\ Error: Compile failed!')