class documentation

Representation of an error in the error log. Attributes: name: The error name. bad_call: Optionally, a `pytype.function.BadCall` of details of a bad function call. details: Optionally, a string of message details. filename: The file in which the error occurred. lineno: The line number at which the error occurred. message: The error message string. methodname: The method in which the error occurred. severity: The error level (error or warning), an integer. keyword: Optionally, the culprit keyword in the line where error is. e.g., message = "No attribute '_submatch' on BasePattern" keyword = _submatch keyword_context: Optionally, a string naming the object on which `keyword` occurs. e.g. the fully qualified module name that a non-existent function doesn't exist on. traceback: Optionally, an error traceback. opcode_name: Optionally, the name of the opcode that raised the error.

Class Method for_test Create an _Error with the specified name, for use in tests.
Class Method with_stack Return an error using a stack for position information.
Method __init__ Undocumented
Method __str__ Undocumented
Method as_string Format the error as a friendly string, optionally with shell coloring.
Method drop_traceback Undocumented
Method set_lineno Undocumented
Property bad_call Undocumented
Property details Undocumented
Property filename Undocumented
Property keyword Undocumented
Property keyword_context Undocumented
Property lineno Undocumented
Property message Undocumented
Property methodname Undocumented
Property name Undocumented
Property opcode_name Undocumented
Property traceback Undocumented
Method _position Return human-readable filename + line number.
Instance Variable _bad_call Undocumented
Instance Variable _details Undocumented
Instance Variable _filename Undocumented
Instance Variable _keyword Undocumented
Instance Variable _keyword_context Undocumented
Instance Variable _lineno Undocumented
Instance Variable _message Undocumented
Instance Variable _methodname Undocumented
Instance Variable _name Undocumented
Instance Variable _opcode_name Undocumented
Instance Variable _severity Undocumented
Instance Variable _traceback Undocumented
@classmethod
def for_test(cls, severity, message, name, **kwargs): (source)

Create an _Error with the specified name, for use in tests.

@classmethod
def with_stack(cls, stack, severity, message, **kwargs): (source)

Return an error using a stack for position information. Args: stack: A list of state.Frame or state.SimpleFrame objects. severity: The error level (error or warning), an integer. message: The error message string. **kwargs: Additional keyword args to pass onto the class ctor. Returns: An Error object.

def __init__(self, severity, message, filename=None, lineno=0, methodname=None, details=None, traceback=None, keyword=None, keyword_context=None, bad_call=None, opcode_name=None): (source)

Undocumented

def __str__(self): (source)

Undocumented

def as_string(self, *, color=False): (source)

Format the error as a friendly string, optionally with shell coloring.

def drop_traceback(self): (source)

Undocumented

def set_lineno(self, line): (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

@property
keyword_context = (source)

Undocumented

Undocumented

Undocumented

Undocumented

Undocumented

@property
opcode_name = (source)

Undocumented

Undocumented

def _position(self): (source)

Return human-readable filename + line number.

_bad_call = (source)

Undocumented

_details = (source)

Undocumented

_filename = (source)

Undocumented

_keyword = (source)

Undocumented

_keyword_context = (source)

Undocumented

Undocumented

_message = (source)

Undocumented

_methodname = (source)

Undocumented

Undocumented

_opcode_name = (source)

Undocumented

_severity = (source)

Undocumented

_traceback = (source)

Undocumented