summaryrefslogtreecommitdiff
path: root/heat/common
diff options
context:
space:
mode:
authorhuangtianhua <huangtianhua@huawei.com>2017-08-03 11:56:11 +0800
committerhuangtianhua <huangtianhua@huawei.com>2017-11-09 16:24:40 +0800
commit8cdfc3b293027292d21974b8152f42426d1f61ae (patch)
tree0acf5019add5bd66395361b1b2db3e89d55ac020 /heat/common
parent78a48ad4c4edcdb8a98d75d984aa412d61f07c66 (diff)
downloadheat-8cdfc3b293027292d21974b8152f42426d1f61ae.tar.gz
Don't return the sensitive information to user
We return back the sensitive information to user when some exceptions happened, for example, when DBError happened, we return the whole sql statement to user, it's not safe. This patch changes to return the message if the exception is the HeatException, otherwise the message won't be revealed to user. Change-Id: I6e01b1003a39106274e79c3b413917a30b5651b6 Closes-Bug: #1708122
Diffstat (limited to 'heat/common')
-rw-r--r--heat/common/exception.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/heat/common/exception.py b/heat/common/exception.py
index e49897164..f42c9e07f 100644
--- a/heat/common/exception.py
+++ b/heat/common/exception.py
@@ -55,6 +55,8 @@ class HeatException(Exception):
# YYY - Specific error code for a given exception.
error_code = None
+ safe = True
+
def __init__(self, **kwargs):
self.kwargs = kwargs
@@ -448,6 +450,8 @@ class HTTPExceptionDisguise(Exception):
They can be handled by the webob fault application in the wsgi pipeline.
"""
+ safe = True
+
def __init__(self, exception):
self.exc = exception
self.tb = sys.exc_info()[2]