]> www.vanbest.org Git - motioneye-debian/commitdiff
"stream is closed" IOError is now caught for local current picture
authorCalin Crisan <ccrisan@gmail.com>
Sat, 18 Jan 2014 18:21:47 +0000 (20:21 +0200)
committerCalin Crisan <ccrisan@gmail.com>
Sat, 18 Jan 2014 18:21:47 +0000 (20:21 +0200)
requests

src/handlers.py

index 4117c2fa607a59da3a53e03797e7f8fcfa0a08a0..09e4dcbb6303168dc1e9c2b794f78e7e9f31da6b 100644 (file)
@@ -546,8 +546,12 @@ class PictureHandler(BaseHandler):
             if sequence and picture:
                 mediafiles.set_picture_cache(camera_id, sequence, width, picture)
 
-            self.finish(picture)
+            try:
+                self.finish(picture)
         
+            except IOError as e:
+                logging.warning('could not write picture as response: %(msg)s' % {'msg': unicode(e)})
+                
         else:
             def on_response(picture):
                 if sequence and picture: