From 02c7010961432c28ecaf0a7aada29d0191e4f37e Mon Sep 17 00:00:00 2001 From: Tetsuro Nakamura Date: Tue, 17 Jul 2018 21:53:23 +0900 Subject: [PATCH] Change invalid date error code to 400 The create lease API and the update lease API returned a 500 response status code when the date format is invalid. But this should be 400 BadRequest as well as wrong time order (InvalidInput) exception. This patch changes it to return a 400 response status code. Change-Id: I7f259d06d8b5e0b901126064a21d313497721e1b --- blazar/manager/exceptions.py | 1 + 1 file changed, 1 insertion(+) diff --git a/blazar/manager/exceptions.py b/blazar/manager/exceptions.py index dd35fdb8..4907ffc1 100644 --- a/blazar/manager/exceptions.py +++ b/blazar/manager/exceptions.py @@ -82,6 +82,7 @@ class EventError(exceptions.BlazarException): class InvalidDate(exceptions.BlazarException): + code = 400 msg_fmt = _( '%(date)s is an invalid date. Required format: %(date_format)s')