Merge pull request #152 from dod-ccpo/log-errors

Log errors
This commit is contained in:
dandds 2018-08-09 12:41:00 -04:00 committed by GitHub
commit 28665c32f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -27,4 +27,6 @@ class UnauthorizedError(Exception):
class UnauthenticatedError(Exception):
pass
@property
def message(self):
return str(self)

View File

@ -8,12 +8,14 @@ def make_error_pages(app):
@app.errorhandler(exceptions.UnauthorizedError)
# pylint: disable=unused-variable
def not_found(e):
app.logger.error(e.message)
return render_template("not_found.html"), 404
@app.errorhandler(exceptions.UnauthenticatedError)
# pylint: disable=unused-variable
def unauthorized(e):
return render_template('unauthorized.html'), 401
app.logger.error(e.message)
return render_template('unauthenticated.html'), 401
return app

View File

@ -4,7 +4,7 @@
<main class="usa-section usa-content">
<h1>Unauthorized</h1>
<h1>Log in Failed</h1>
</main>