From ae3175c8052a129c5f5a52a6c82dc5864f41bb79 Mon Sep 17 00:00:00 2001 From: James Allen Date: Thu, 5 Feb 2015 12:57:44 +0000 Subject: [PATCH] Show cookies error message on forbidden response --- .../web/public/coffee/directives/asyncForm.coffee | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/services/web/public/coffee/directives/asyncForm.coffee b/services/web/public/coffee/directives/asyncForm.coffee index eb9a73b435..6e4ae013d9 100644 --- a/services/web/public/coffee/directives/asyncForm.coffee +++ b/services/web/public/coffee/directives/asyncForm.coffee @@ -42,9 +42,14 @@ define [ scope[attrs.name].inflight = false response.success = false response.error = true - response.message = - text: data.message?.text or data.message or "Something went wrong talking to the server :(. Please try again." - type: 'error' + 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" + else + response.message = + text: data.message?.text or data.message or "Something went wrong talking to the server :(. Please try again." + type: 'error' ga('send', 'event', formName, 'failure', data.message) }