From 10a341db4627d9d49cd477682f6a4d75795d9221 Mon Sep 17 00:00:00 2001 From: Dan Anstis Date: Sun, 29 Oct 2017 16:00:13 +1100 Subject: [PATCH] Handle returned errors for the GetToken method - Fixes #59 (#60) --- CHANGELOG.md | 6 +++++- main.go | 9 ++++++--- plex/version.go | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4a27ad..3aff666 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [v0.4.1] +### Fixed +- ([#59](https://github.com/danstis/Plex-Sync/issues/59)) Handle returned errors for the GetToken method. ## [v0.4.0] ### Changed @@ -55,7 +58,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). - App would attempt to sync even if a token was not obtained. - Spaces in TV Show names cause errors. -[unreleased]: https://github.com/danstis/Plex-Sync/compare/v0.4.0...HEAD +[unreleased]: https://github.com/danstis/Plex-Sync/compare/v0.4.1...HEAD +[v0.4.1]: https://github.com/danstis/Plex-Sync/compare/v0.4.0...v0.4.1 [v0.4.0]: https://github.com/danstis/Plex-Sync/compare/v0.3.4...v0.4.0 [v0.3.4]: https://github.com/danstis/Plex-Sync/compare/v0.3.1...v0.3.4 [v0.3.1]: https://github.com/danstis/Plex-Sync/compare/v0.3.0...v0.3.1 diff --git a/main.go b/main.go index 6649f5f..42a3a94 100644 --- a/main.go +++ b/main.go @@ -51,9 +51,12 @@ func main() { for { token := plex.Token() if token != "" { - localServer.GetToken(token) - remoteServer.GetToken(token) - + if err = localServer.GetToken(token); err != nil { + log.Printf("ERROR: %v", err) + } + if err = remoteServer.GetToken(token); err != nil { + log.Printf("ERROR: %v", err) + } plex.SyncWatchedTv(localServer, remoteServer) } log.Printf("Sleeping for %v...", (sleepInterval * time.Second)) diff --git a/plex/version.go b/plex/version.go index 073881d..010c08b 100644 --- a/plex/version.go +++ b/plex/version.go @@ -1,4 +1,4 @@ package plex // Version contains the version of the app. -const Version = "0.4.0" +const Version = "0.4.1-beta.2"