def get_errors(self, with_context=False):
# type: (bool) -> Dict[Text, List[Dict[Text, Text]]]
"""
Returns a dict of error messages generated by the Filter, in a
format suitable for inclusion in e.g., an API 400 response
payload.
:param with_context:
Whether to include the context object in the result (for
debugging purposes).
Note: context is usually not safe to expose to end users!
"""
return {
key: [m.as_dict(with_context) for m in messages]
for key, messages in iteritems(self.filter_messages)
}
评论列表
文章目录