Python message patterns
Here is a comprehensive list of exception message patterns the default grouping algorithm recognizes in python. For each pattern you will find:
- Condition: circumstances under which we apply the pattern
- Patterns: one or more regular expressions that we use to match against the exception message
- Applied grouping: the fields we include when computing the fingerprint when the pattern matches
AttributeError
AttributeError
-
Condition:
language
ispython
- root exception class is
AttributeError
-
Patterns:
^'<object>' object has no attribute '<attribute>'$
object
:(\w+)
attribute
:(\w+)
-
Applied grouping:
- Include
object
andattribute
in the fingerprint
- Include
DoesNotExist
DoesNotExist
-
Condition:
language
ispython
- root exception class is
DoesNotExist
-
Patterns:
^<model> matching query does not exist\.$
model
:(\w+)
-
Applied grouping:
- Include
model
in the fingerprint
- Include
HTTPError
HTTPError
-
Condition:
language
ispython
- root exception class is
HTTPError
-
Patterns:
^<status_code> Client Error: <error> for url: <url>$
status_code
:(4\d\d)
error
:(.*)
url
:(\S+)
^<status_code> Server Error: <error> for url: <url>$
status_code
:(5\d\d)
error
:(.*)
url
:(\S+)
-
Applied grouping:
- Include
status_code
in the fingerprint
- Include
IndexError
IndexError
-
Condition:
language
ispython
- root exception class is
IndexError
-
Patterns:
^<iterable> index out of range$
iterable
:(\w+)
-
Applied grouping:
- Do not include any variables
NameError
- (local) Name not defined
NameError
- (local) Name not defined-
Condition:
language
ispython
- root exception class is
NameError
-
Patterns:
^name '<variable_name>' is not defined$
variable_name
:(\S+)
-
Applied grouping:
- Include
variable_name
in the fingerprint
- Include
NameError
- Global name not defined
NameError
- Global name not defined-
Condition:
language
ispython
- root exception class is
NameError
-
Patterns:
^global name '<variable_name>' is not defined$
variable_name
:(\S+)
-
Applied grouping:
- Include
variable_name
in the fingerprint
- Include
TypeError
- No method defined
TypeError
- No method defined-
Condition:
language
ispython
- root exception class is
TypeError
-
Patterns:
^'<class_name>' object is not subscriptable$
class_name
:(\S+)
^'<class_name>' object is not iterable$
class_name
:(\S+)
^'<class_name>' object is not callable
class_name
:(\S+)
^object of type '<class_name>' has no <method_name>$
class_name
:(\S+)
method_name
:(\S+)
-
Applied grouping:
- Include
class_name
andmethod_name
in the fingerprint
- Include
TypeError
- Unsupported operator
TypeError
- Unsupported operator-
Condition:
language
ispython
- root exception class is
TypeError
-
Patterns:
^unsupported operand type\(s\) for <operator>: '<lhs>' and '<rhs>'$
operator
:(\S+)
lhs
:(\S+)
rhs
:(\S+)
^'<operator>' not supported between instances of '<lhs>' and '<rhs>'$
operator
:(\S+)
lhs
:(\S+)
rhs
:(\S+)
-
Applied grouping:
- Include
lhs
andrhs
in the fingerprint
- Include
TypeError
- Object is not JSON serializable
TypeError
- Object is not JSON serializable-
Condition:
language
ispython
- root exception class is
TypeError
-
Patterns:
^Object of type <class_name> is not JSON serializable$
class_name
:(\S+)
-
Applied grouping:
- Include
class_name
in the fingerprint
- Include
Updated 5 months ago