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
1f1ebacf
Commit
1f1ebacf
authored
Jan 16, 2016
by
miigotu
Browse files
Options
Downloads
Plain Diff
Merge pull request #756 from SickRage/telegram
Change Errors to Warnings on Telegram
parents
0b119151
bfd0b68d
Branches
Branches containing commit
Tags
V4.2.0.01
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sickbeard/notifiers/telegram.py
+8
-18
8 additions, 18 deletions
sickbeard/notifiers/telegram.py
with
8 additions
and
18 deletions
sickbeard/notifiers/telegram.py
+
8
−
18
View file @
1f1ebacf
...
...
@@ -59,30 +59,20 @@ class TelegramNotifier(object):
try
:
urllib2
.
urlopen
(
req
)
message
=
"
Telegram message sent successfully.
"
except
IOError
as
e
:
if
hasattr
(
e
,
'
code
'
):
if
e
.
code
==
400
:
message
=
"
Missing parameter(s).
"
logger
.
log
(
message
,
logger
.
ERROR
)
return
False
,
message
if
e
.
code
==
401
:
message
=
"
Authentication failed.
"
logger
.
log
(
message
,
logger
.
ERROR
)
return
False
,
message
if
e
.
code
==
420
:
message
=
"
Too many messages.
"
logger
.
log
(
message
,
logger
.
ERROR
)
return
False
,
message
if
e
.
code
==
500
:
message
=
"
Server error. Please retry in few moment.
"
logger
.
log
(
message
,
logger
.
ERROR
)
return
False
,
message
message
=
{
400
:
'
Missing parameter(s) double check your settings or if the channel/user exists.
'
,
401
:
'
Authentication failed.
'
,
420
:
'
Too many messages.
'
,
500
:
'
Server error. Please retry in few moment.
'
,}
logger
.
log
(
'
Telegram: %s
'
%
message
.
get
(
e
.
code
,
'
Unknown error
'
),
logger
.
WARNING
)
return
False
,
message
.
get
(
e
.
code
,
'
Unknown error
'
)
except
Exception
as
e
:
message
=
u
"
Error while sending Telegram message: {0}
"
.
format
(
e
)
logger
.
log
(
message
,
logger
.
ERROR
)
return
False
,
message
message
=
"
Telegram message sent successfully.
"
logger
.
log
(
message
,
logger
.
INFO
)
return
True
,
message
...
...
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