Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
storjstatus-client
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
James Coyle
storjstatus-client
Commits
334e864a
Commit
334e864a
authored
Feb 16, 2018
by
James Coyle
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tidy up error handling
parent
1a844175
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
storjalytics/storjalytics_send.py
storjalytics/storjalytics_send.py
+3
-4
No files found.
storjalytics/storjalytics_send.py
View file @
334e864a
...
...
@@ -72,7 +72,7 @@ def init_send():
try
:
resp
=
requests
.
post
(
storjalytics_common
.
APIENDPOINT
+
"stats"
,
json
=
json_request
,
headers
=
headers
)
if
not
resp
.
status_code
==
200
:
print_error
(
"Value returned when posting stats : "
+
resp
.
json
()[
'description'
]
,
False
)
print_error
(
"Value returned when posting stats : "
+
resp
.
json
()[
'description'
])
except
Exception
as
e
:
print
(
str
(
e
))
print_error
(
"Error sending report to: "
+
storjalytics_common
.
APIENDPOINT
+
"stats. Please try again later"
)
...
...
@@ -85,13 +85,12 @@ def checks():
if
not
os
.
path
.
isfile
(
storjalytics_common
.
CONFIGFILE
):
print_error
(
'Server config file does not exist at '
+
storjalytics_common
.
CONFIGFILE
)
exit
(
1
)
# Check strojshare exists
code
,
result
=
storjalytics_common
.
check_strojshare
()
if
code
!=
"OK"
:
print_error
(
result
,
False
)
print_error
(
result
)
def
storjshare_version
():
...
...
@@ -112,7 +111,7 @@ def storjshare_version():
def
bridge_info
(
id
):
resp
=
requests
.
get
(
"https://api.storj.io/contacts/"
+
id
)
if
not
resp
.
status_code
==
200
:
print_error
(
"Code returned when querying bridge : "
+
rstatus_code
,
False
)
print_error
(
"Code returned when querying bridge : "
+
rstatus_code
)
return
json
.
loads
(
resp
.
content
.
decode
(
'utf-8'
))
...
...
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