Commit 68533e15 by Kálmán Viktor

dashboard: add logging to failed requests in store

parent b8d089c1
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", "[]")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment