Better logging for freezer ui
Add a LOG.error(error.message) in the shield decorator to save those logs in case of an exception. Resolves bug: 1532772 Change-Id: Ic43a5a7eb048512f6079e56e2230aaa954a1449d
This commit is contained in:
parent
5639930484
commit
3d7f4226b6
|
@ -10,6 +10,8 @@
|
||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
|
import logging
|
||||||
|
|
||||||
import datetime
|
import datetime
|
||||||
import uuid
|
import uuid
|
||||||
import re
|
import re
|
||||||
|
@ -23,6 +25,9 @@ from django.utils.translation import ugettext_lazy as _
|
||||||
from horizon import exceptions
|
from horizon import exceptions
|
||||||
|
|
||||||
|
|
||||||
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def create_dict(**kwargs):
|
def create_dict(**kwargs):
|
||||||
"""Create a dict only with values that exists so we avoid send keys with
|
"""Create a dict only with values that exists so we avoid send keys with
|
||||||
None values
|
None values
|
||||||
|
@ -181,7 +186,8 @@ def shield(message, redirect=''):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return function(request, *args, **kwargs)
|
return function(request, *args, **kwargs)
|
||||||
except Exception:
|
except Exception as error:
|
||||||
|
LOG.error(error.message)
|
||||||
namespace = "horizon:disaster_recovery:"
|
namespace = "horizon:disaster_recovery:"
|
||||||
r = reverse("{0}{1}".format(namespace, redirect))
|
r = reverse("{0}{1}".format(namespace, redirect))
|
||||||
exceptions.handle(request, _(message), redirect=r)
|
exceptions.handle(request, _(message), redirect=r)
|
||||||
|
|
Loading…
Reference in New Issue