Commit 0505e140 by carpoon

add some logging for the store

parent 71d6ccff
...@@ -71,19 +71,19 @@ class StoreList(LoginRequiredMixin, TemplateView): ...@@ -71,19 +71,19 @@ class StoreList(LoginRequiredMixin, TemplateView):
try: try:
if self.request.is_ajax(): if self.request.is_ajax():
context = self.get_context_data(**kwargs) context = self.get_context_data(**kwargs)
return render_to_response( return render(self.request, "dashboard/store/_list-box.html", context)
"dashboard/store/_list-box.html",
context, self.request
)
else: else:
return super(StoreList, self).get(*args, **kwargs) return super(StoreList, self).get(*args, **kwargs)
except NoStoreException: except NoStoreException:
messages.warning(self.request, _("No store.")) messages.warning(self.request, _("No store."))
except NotOkException: except NotOkException as e:
logger.error("Store error: %s" % unicode(e))
logger.exception(e)
messages.warning(self.request, _("Store has some problems now." messages.warning(self.request, _("Store has some problems now."
" Try again later.")) " Try again later."))
except Exception as e: except Exception as e:
logger.critical("Something is wrong with store: %s", unicode(e)) logger.critical("Something is wrong with store: %s", unicode(e))
logger.exception(e)
messages.warning(self.request, _("Unknown store error.")) messages.warning(self.request, _("Unknown store error."))
return redirect("/") return redirect("/")
......
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