Преглед изворни кода

Add error handling for 400 responses

Alasdair Smith пре 8 година
родитељ
комит
1fe8aebf5b
1 измењених фајлова са 5 додато и 1 уклоњено
  1. 5 1
      services/web/public/coffee/directives/asyncForm.coffee

+ 5 - 1
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"