diff --git a/vinetrimmer/services/amazon.py b/vinetrimmer/services/amazon.py index 97517c0..9f86e9e 100644 --- a/vinetrimmer/services/amazon.py +++ b/vinetrimmer/services/amazon.py @@ -1192,8 +1192,8 @@ class Amazon(BaseService): cookies[cookie['Name']] = cookie['Value'] else: error = response.json()['response']["error"] - #self.cache_path.unlink(missing_ok=True) - self.log.warn(f"Error when refreshing cookies: {error['message']} [{error['code']}]") + self.cache_path.unlink(missing_ok=True) + raise self.log.exit(f"Error when refreshing cookies: {error['message']} [{error['code']}]") # Create a new cookies object to be used with requsts. @@ -1227,7 +1227,7 @@ class Amazon(BaseService): response_json = response.json() if response.status_code != 200 or "error" in response_json: - #self.cache_path.unlink(missing_ok=True) # Remove the cached device as its tokens have expired + self.cache_path.unlink(missing_ok=True) # Remove the cached device as its tokens have expired raise self.log.exit( f"Failed to refresh device token -> {response_json['error_description']} [{response_json['error']}]" )