Merge pull request #3253 from aligoren/document-get-exc-class-and-code

Added :param to the _get_exc_class_and_code method docstring
This commit is contained in:
David Lord 2019-06-12 14:10:42 -07:00 committed by GitHub
commit d5fea5fa1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1270,7 +1270,13 @@ class Flask(_PackageBoundObject):
@staticmethod
def _get_exc_class_and_code(exc_class_or_code):
"""Ensure that we register only exceptions as handler keys"""
"""Get the exception class being handled. For HTTP status codes
or ``HTTPException`` subclasses, return both the exception and
status code.
:param exc_class_or_code: Any exception class, or an HTTP status
code as an integer.
"""
if isinstance(exc_class_or_code, integer_types):
exc_class = default_exceptions[exc_class_or_code]
else: