aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbodqhrohro <bodqhrohro@gmail.com>2019-12-31 00:51:06 +0300
committerbodqhrohro <bodqhrohro@gmail.com>2019-12-31 00:51:06 +0300
commita435a0a556cb88fe1fcc7e3bf860b45530d895e7 (patch)
treed639336d19de8f01a4bfe3a6f97fc23f21f05c15
parent33e564c62ee6ddcd54a295445ffbfb60e50c5b98 (diff)
Display existing symlink errors as warnings
-rw-r--r--telegram/handlers.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/telegram/handlers.go b/telegram/handlers.go
index 847bac8..aaa1e3d 100644
--- a/telegram/handlers.go
+++ b/telegram/handlers.go
@@ -264,7 +264,12 @@ func (c *Client) updateFile(update *client.UpdateFile) {
),
)
if err != nil {
- log.Errorf("Error creating symlink: %v", err)
+ linkErr := err.(*os.LinkError)
+ if linkErr.Err.Error() == "file exists" {
+ log.Warn(err.Error())
+ } else {
+ log.Errorf("Error creating symlink: %v", err)
+ }
}
}