From 0f4130c2674368b79f545120395707d58abeb280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Imanol=20Yan=CC=83ez=20Sastre?= Date: Mon, 9 Jun 2014 09:08:06 +0200 Subject: [PATCH] Removed throw from rest.required --- lib/helpers/rest.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/helpers/rest.coffee b/lib/helpers/rest.coffee index 935ba53..d0cc242 100644 --- a/lib/helpers/rest.coffee +++ b/lib/helpers/rest.coffee @@ -20,9 +20,13 @@ class Rest _inputLog @request if config.environment.log?.request required: (parameters = []) -> + error = false for param in parameters if !@request.params[param]? - throw code: 400, message: "#{param} is required." + error = true + @exception 400, "#{param} is required." + break + error parameter: (name) -> @request.params[name] or null