Skip to content

Commit

Permalink
Merge pull request #992 from alphagov/logging
Browse files Browse the repository at this point in the history
Add error logging
  • Loading branch information
leohemsted committed Oct 19, 2016
2 parents b2d159d + 3058a71 commit 09d7f6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
9 changes: 5 additions & 4 deletions app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import ago
import os
import re
import urllib
import dateutil
from datetime import datetime, timedelta, timezone
from time import monotonic

import dateutil
import pytz
import ago
from flask import (
Flask,
session,
Expand All @@ -16,14 +18,12 @@
request,
g,
url_for)

from flask._compat import string_types
from flask.globals import _lookup_req_object
from flask_login import LoginManager
from flask_wtf import CsrfProtect
from functools import partial

from monotonic import monotonic
from notifications_python_client.errors import HTTPError
from notifications_utils import logging
from notifications_utils.recipients import validate_phone_number, InvalidPhoneError
Expand Down Expand Up @@ -373,6 +373,7 @@ def useful_headers_after_request(response):

def register_errorhandlers(application):
def _error_response(error_code):
application.logger.exception('Admin app errored with %s', error_code)
resp = make_response(render_template("error/{0}.html".format(error_code)), error_code)
return useful_headers_after_request(resp)

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ boto3==1.3.0
Pygments==2.0.2
py-gfm==0.1.2
blinker==1.4
monotonic==0.3
lxml==3.6.0
pyexcel==0.2.1
pyexcel-io==0.1.0
Expand Down

0 comments on commit 09d7f6e

Please sign in to comment.