Browse Source

Make VisitError inherit from LarkError

The recently added VisitError is the only lark exception not inheriting from LarkError,
which makes it painful to catch for client application.
tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.6.6
Aurelien Grenotton 5 years ago
parent
commit
cbafa4d7bb
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      lark/exceptions.py

+ 1
- 1
lark/exceptions.py View File

@@ -86,7 +86,7 @@ class UnexpectedToken(ParseError, UnexpectedInput):

super(UnexpectedToken, self).__init__(message)

class VisitError(Exception):
class VisitError(LarkError):
def __init__(self, tree, orig_exc):
self.tree = tree
self.orig_exc = orig_exc


Loading…
Cancel
Save