From 254405b384978d412fd9505d208d26ea24069f95 Mon Sep 17 00:00:00 2001 From: vicky Date: Fri, 27 May 2022 19:59:25 +0200 Subject: [PATCH] changed error name --- src/bootstraparse/modules/error_mngr.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bootstraparse/modules/error_mngr.py b/src/bootstraparse/modules/error_mngr.py index 323cb4a..9110ed7 100644 --- a/src/bootstraparse/modules/error_mngr.py +++ b/src/bootstraparse/modules/error_mngr.py @@ -136,10 +136,11 @@ class ParsingError(Exception): return str(self.message) -class CannotBeContainedError(Exception): +class MismatchedContainerError(Exception): """ The token is not final and cannot be contained. Indicative of a mismatched token. """ - def __init__(self, token): + def __init__(self, token, line=-1): # TODO: context_manager needs to pass over line for error handling self.token = token - super().__init__(f"Could not process {token.label}") + self.line = line + super().__init__(f"Could not process {token.label} in line {line}.")