'Ensure that we register only exceptions as handler keys'

@staticmethod
def _get_exc_class_and_code(exc_class_or_code):

    if isinstance(exc_class_or_code, integer_types):
        exc_class = default_exceptions[exc_class_or_code]
    else:
        exc_class = exc_class_or_code
    assert issubclass(exc_class, Exception)
    if issubclass(exc_class, HTTPException):
        return (exc_class, exc_class.code)
    else:
        return (exc_class, None)
