diff --git a/app/__init__.py b/app/__init__.py
index cd58b8c3a..c469b4a27 100644
--- a/app/__init__.py
+++ b/app/__init__.py
@@ -503,6 +503,10 @@ def register_errorhandlers(application): # noqa (C901 too complex)
def handle_gone(error):
return _error_response(410)
+ @application.errorhandler(413)
+ def handle_payload_too_large(error):
+ return _error_response(413)
+
@application.errorhandler(404)
def handle_not_found(error):
return _error_response(404)
diff --git a/app/assets/error_pages/413.html b/app/assets/error_pages/413.html
deleted file mode 100644
index 8998ef326..000000000
--- a/app/assets/error_pages/413.html
+++ /dev/null
@@ -1,148 +0,0 @@
-
-
-
- GOV.UK Notify - The file you uploaded was too big
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- The file you uploaded was too big
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/main/views/index.py b/app/main/views/index.py
index a00ab5523..56bdfe03f 100644
--- a/app/main/views/index.py
+++ b/app/main/views/index.py
@@ -1,4 +1,4 @@
-from flask import redirect, render_template, request, url_for
+from flask import abort, redirect, render_template, request, url_for
from flask_login import current_user, login_required
from notifications_utils.international_billing_rates import (
INTERNATIONAL_BILLING_RATES,
@@ -18,6 +18,13 @@ def index():
return render_template('views/signedout.html')
+@main.route('/error/')
+def error(status_code):
+ if status_code >= 500:
+ abort(404)
+ abort(status_code)
+
+
@main.route("/verify-mobile")
@login_required
def verify_mobile():
diff --git a/app/templates/error/413.html b/app/templates/error/413.html
new file mode 100644
index 000000000..4dfddc603
--- /dev/null
+++ b/app/templates/error/413.html
@@ -0,0 +1,21 @@
+{% extends "withoutnav_template.html" %}
+{% block per_page_title %}File too big{% endblock %}
+{% block maincolumn_content %}
+
+
+
+ The file you uploaded was too big
+
+
+
+
+{% endblock %}