Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
J
jpush-api-python-client
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
jpush-api-python-client
Commits
c52c82be
Commit
c52c82be
authored
Apr 25, 2019
by
laodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix exception issue
parent
151f2782
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
1 deletion
+2
-1
common.py
jpush/common.py
+1
-0
core.py
jpush/core.py
+1
-1
No files found.
jpush/common.py
View file @
c52c82be
...
@@ -91,6 +91,7 @@ class APIConnectionException(Exception):
...
@@ -91,6 +91,7 @@ class APIConnectionException(Exception):
class
APIRequestException
(
Exception
):
class
APIRequestException
(
Exception
):
def
__init__
(
self
,
value
):
def
__init__
(
self
,
value
):
self
.
value
=
value
self
.
value
=
value
super
(
Exception
,
self
)
.
__init__
(
value
)
def
__str__
(
self
):
def
__str__
(
self
):
return
repr
(
self
.
value
)
return
repr
(
self
.
value
)
...
...
jpush/core.py
View file @
c52c82be
...
@@ -36,7 +36,7 @@ class JPush(object):
...
@@ -36,7 +36,7 @@ class JPush(object):
except
requests
.
exceptions
.
ConnectTimeout
:
except
requests
.
exceptions
.
ConnectTimeout
:
raise
common
.
APIConnectionException
(
"Connection to api.jpush.cn timed out."
)
raise
common
.
APIConnectionException
(
"Connection to api.jpush.cn timed out."
)
except
Exception
:
except
Exception
:
raise
common
.
API
Connection
Exception
(
"Connection to api.jpush.cn error."
)
raise
common
.
API
Request
Exception
(
"Connection to api.jpush.cn error."
)
logger
.
debug
(
"Received
%
s response. Headers:
\n\t
%
s
\n
Body:
\n\t
%
s"
,
response
.
status_code
,
'
\n\t
'
.
join
(
logger
.
debug
(
"Received
%
s response. Headers:
\n\t
%
s
\n
Body:
\n\t
%
s"
,
response
.
status_code
,
'
\n\t
'
.
join
(
'
%
s:
%
s'
%
(
key
,
value
)
for
(
key
,
value
)
in
response
.
headers
.
items
()),
response
.
content
)
'
%
s:
%
s'
%
(
key
,
value
)
for
(
key
,
value
)
in
response
.
headers
.
items
()),
response
.
content
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment