New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[plugin] Wallabag: abort synchronisation on request error #8950
Conversation
plugins/wallabag.koplugin/main.lua
Outdated
@@ -430,6 +430,12 @@ function Wallabag:getArticleList() | |||
.. filtering | |||
local articles_json = self:callAPI("GET", articles_url, nil, "", "", true) | |||
|
|||
if articles_json == false then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic can't be right. ;-) This is identical to replacing the break
a few lines down with return
.
I haven't had the time to look at it, but the most typical idiom is probably to pass a reason along.
For example, at its simplest:
false, "connection error"
While if it's an HTTP error code, maybe
false, "http", status
In any case, the problem is that a "proper" error is conflated with another type. Conflating them the other way around would retain that problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I didn't see initially that non-200 http responses were also returning false instead of nil. Errors are handled when retrieving entries now. Error handling for minor actions (adding tags, adding/removing articles) is not implemented yet.
… on request error Fixes <koreader#8949>.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks okay at a glance. Did you test the different scenarios?
I tested some scenarios that would trigger a network_error. I have been using this patch for the past two weeks without noticing any other issues. |
Fixes #8949. Not tested yet.
This change is