From 1fe8aebf5bdcc1e5d20c709f723d7d023d1f1ca7 Mon Sep 17 00:00:00 2001 From: Alasdair Smith Date: Thu, 4 Oct 2018 10:36:22 +0100 Subject: [PATCH] Add error handling for 400 responses --- services/web/public/coffee/directives/asyncForm.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/web/public/coffee/directives/asyncForm.coffee b/services/web/public/coffee/directives/asyncForm.coffee index acafec563d..9baadfd1f2 100644 --- a/services/web/public/coffee/directives/asyncForm.coffee +++ b/services/web/public/coffee/directives/asyncForm.coffee @@ -70,7 +70,11 @@ define [ onErrorHandler(httpResponse) return - if status == 403 # Forbidden + if status == 400 # Bad Request + response.message = + text: "Invalid Request. Please correct the data and try again." + type: 'error' + else if status == 403 # Forbidden response.message = text: "Session error. Please check you have cookies enabled. If the problem persists, try clearing your cache and cookies." type: "error"