Private GIT
Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SickRage-1
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vlbox
SickRage-1
Commits
d5c8664d
Commit
d5c8664d
authored
9 years ago
by
miigotu
Browse files
Options
Downloads
Patches
Plain Diff
Simplify NN API error codes/descriptions and just use the description given by the provier
Fixes
https://github.com/SickRage/sickrage-issues/issues/128
parent
5fb76f4f
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/providers/newznab.py
+6
-13
6 additions, 13 deletions
sickbeard/providers/newznab.py
with
6 additions
and
13 deletions
sickbeard/providers/newznab.py
+
6
−
13
View file @
d5c8664d
...
...
@@ -36,7 +36,7 @@ from sickbeard import tvcache
from
sickbeard
import
db
from
sickbeard.common
import
Quality
from
sickbeard.providers
import
generic
from
sickrage.helper.encoding
import
ek
from
sickrage.helper.encoding
import
ek
,
ss
from
sickrage.show.Show
import
Show
from
sickrage.helper.common
import
try_int
from
sickbeard.common
import
USER_AGENT
...
...
@@ -214,23 +214,16 @@ class NewznabProvider(generic.NZBProvider):
return
self
.
_checkAuth
()
try
:
err_code
=
int
(
data
.
error
.
attrs
[
'
code
'
])
err_desc
=
data
.
error
.
attrs
[
'
description
'
]
if
not
(
err_code
or
err_desc
)
:
if
not
err_desc
:
raise
except
(
AssertionError
,
AttributeError
,
ValueError
):
return
self
.
_checkAuth
()
if
err_code
==
100
:
logger
.
log
(
u
'
Your API key for %s is incorrect, please check your config.
'
%
self
.
name
)
elif
err_code
==
101
:
logger
.
log
(
u
'
Your account on %s has been suspended, contact the administrator.
'
%
self
.
name
)
elif
err_code
==
102
:
logger
.
log
(
u
'
Your account is not allowed to use the API on %s, contact the administrator
'
%
self
.
name
)
elif
err_code
==
500
:
logger
.
log
(
u
'
Your account for %s has reached the api limit
'
%
self
.
name
)
else
:
logger
.
log
(
u
'
Unknown error: %s
'
%
err_desc
,
logger
.
ERROR
)
# This is all we should really need, the code is irrelevant
# Provider name is the thread name, and this should INFO,
# DEBUG hides from the user, WARNING nags the user, ERROR spams the tracker
logger
.
log
(
ss
(
err_desc
))
return
False
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment