class_docstr: Raise an exception when the lexer generates an error token.
  
  Options accepted:
  
  `excclass` : Exception class
    The exception class to raise.
    The default is `pygments.filters.ErrorToken`.
  
  .. versionadded:: 0.8
class_docstr_tok: ["Raise","an","exception","when","the","lexer","generates","an","error","token",".","Options","accepted",":","`","excclass","`",":","Exception","class","The","exception","class","to","raise",".","The","default","is","`","pygments.filters.ErrorToken","`",".","..","versionadded",":",":","0.8"]
code: def __init__(self, **options):
      Filter.__init__(self, **options)
      self.exception = options.get("excclass", ErrorToken)
      try:
          # issubclass() will raise TypeError if first argument is not a class
          if not issubclass(self.exception, Exception):
              raise TypeError
      except TypeError:
          raise OptionError("excclass option is not an exception class")
  
imports: import re
  from pygments.token import String, Comment, Keyword, Name, Error, Whitespace, string_to_tokentype
  from pygments.filter import Filter
  from pygments.util import get_list_opt, get_int_opt, get_bool_opt, get_choice_opt, ClassNotFound, OptionError, text_type, string_types
  from pygments.plugin import find_plugin_filters
label_desc: Use image node_id 1 to create a new RaiseOnErrorTokenFilter object from inherited base classes: Filter with example: obj = RaiseOnErrorTokenFilter()