Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
68533e15
authored
Jul 10, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: add logging to failed requests in store
parent
b8d089c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
circle/dashboard/store_api.py
+7
-2
No files found.
circle/dashboard/store_api.py
View file @
68533e15
from
django.http
import
Http404
import
json
import
logging
import
requests
from
datetime
import
datetime
...
...
@@ -7,6 +8,8 @@ from sizefield.utils import filesizeformat
from
django.conf
import
settings
logger
=
logging
.
getLogger
(
__name__
)
class
Mock
(
object
):
pass
...
...
@@ -42,7 +45,8 @@ def post_request(url, payload, timeout=None):
**
get_request_arguments
(
settings
.
STORE_SSL_AUTH
,
settings
.
STORE_BASIC_AUTH
))
return
r
except
Exception
:
except
Exception
as
e
:
logger
.
error
(
"Error in store POST:
%
s"
%
e
)
dummy
=
Mock
()
setattr
(
dummy
,
"status_code"
,
200
)
setattr
(
dummy
,
"content"
,
"[]"
)
...
...
@@ -56,7 +60,8 @@ def get_request(url, timeout=None):
**
get_request_arguments
(
settings
.
STORE_SSL_AUTH
,
settings
.
STORE_BASIC_AUTH
))
return
r
except
Exception
:
except
Exception
as
e
:
logger
.
error
(
"Error in store GET:
%
s"
%
e
)
dummy
=
Mock
()
setattr
(
dummy
,
"status_code"
,
200
)
setattr
(
dummy
,
"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