Log fsync errors
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 1 Mar 2016 15:38:56 +0000 (16:38 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Tue, 1 Mar 2016 15:38:56 +0000 (16:38 +0100)
commands/hugo.go

index 83dae0d118da211d6e37c0efdcc8e77f9734a923..dd3ca289e481990e316ad3fd59c373fcad5eed27 100644 (file)
@@ -847,7 +847,9 @@ func NewWatcher(port int) error {
                                                                } else if err == nil {
                                                                        // If file still exists, sync it
                                                                        logger.Println("Syncing", relPath, "to", publishDir)
-                                                                       syncer.Sync(filepath.Join(publishDir, relPath), relPath)
+                                                                       if err := syncer.Sync(filepath.Join(publishDir, relPath), relPath); err != nil {
+                                                                               jww.ERROR.Println(err)
+                                                                       }
                                                                } else {
                                                                        jww.ERROR.Println(err)
                                                                }
@@ -857,7 +859,9 @@ func NewWatcher(port int) error {
 
                                                        // For all other event operations Hugo will sync static.
                                                        logger.Println("Syncing", relPath, "to", publishDir)
-                                                       syncer.Sync(filepath.Join(publishDir, relPath), relPath)
+                                                       if err := syncer.Sync(filepath.Join(publishDir, relPath), relPath); err != nil {
+                                                               jww.ERROR.Println(err)
+                                                       }
                                                }
                                        }