# coding:utf-8
"""Some error class, subclass of `HTTPError`."""

from tornado.web import HTTPError


class ParseJSONError(HTTPError):
    """Exception raised by `BaseHandler.parse_json`.

    This is a subclass of `HTTPError`, so if it is uncaught a 400 response
    code will be used instead of 500 (and a stack trace will not be logged).
    """

    def __init__(self, doc):
        super(ParseJSONError, self).__init__(
            400,
            f'ParseJSONError "{doc}"')
