From 0753a17796707f6b5937423e2ae468b23d0174ca Mon Sep 17 00:00:00 2001 From: Paul Liverman III Date: Tue, 24 Apr 2018 07:03:38 -0700 Subject: [PATCH] error testing api handler --- applications/api.moon | 3 +++ 1 file changed, 3 insertions(+) diff --git a/applications/api.moon b/applications/api.moon index 4c361c5..8d75ed1 100644 --- a/applications/api.moon +++ b/applications/api.moon @@ -23,6 +23,9 @@ class API extends Application handle_error: (err, trace) => return status: 500, json: { errors: {err}, :trace } -- NOTE trace should be saved and NOT returned to the user + [err_test: "/err"]: => + error! + [new: "/new"]: capture_errors_json json_params => assert_valid @params, { {"content", exists: true, min_length: 1, "Task content not specified."}