Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
sakia
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Santiago
sakia
Commits
fa35b126
Commit
fa35b126
authored
10 years ago
by
inso
Browse files
Options
Downloads
Patches
Plain Diff
Let's try to catch all RequestException at first
parent
dad87068
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/cutecoin/core/community.py
+4
-3
4 additions, 3 deletions
src/cutecoin/core/community.py
with
4 additions
and
3 deletions
src/cutecoin/core/community.py
+
4
−
3
View file @
fa35b126
...
...
@@ -270,11 +270,12 @@ class Community(object):
continue
else
:
raise
except
Timeout
:
except
RequestException
:
# Move the timeout peer to the end
self
.
peers
.
remove
(
peer
)
self
.
peers
.
append
(
peer
)
continue
raise
NoPeerAvailable
(
self
.
currency
,
len
(
self
.
peers
))
def
post
(
self
,
request
,
req_args
=
{},
post_args
=
{}):
...
...
@@ -287,7 +288,7 @@ class Community(object):
return
except
ValueError
as
e
:
raise
except
Timeout
:
except
RequestException
:
# Move the timeout peer to the end
self
.
peers
.
remove
(
peer
)
self
.
peers
.
append
(
peer
)
...
...
@@ -310,7 +311,7 @@ class Community(object):
except
ValueError
as
e
:
value_error
=
e
continue
except
Timeout
:
except
RequestException
:
tries
=
tries
+
1
# Move the timeout peer to the end
self
.
peers
.
remove
(
peer
)
...
...
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