<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def error(self, msg, previous=False):
 """ Raise a ParseException. We provide information to help locate the error in the config to allow easy config debugging for users. previous indicates that the error actually occurred at the end of the previous line. """

        token = self.tokens[self.current_token - 1]
        line_no = self.line
        if previous:
            line_no -= 1
        line = self.raw[line_no]
        position = token["start"] - self.line_start
        if previous:
            position = len(line) + 2
        raise ParseException(msg, line, line_no + 1, position, token["value"])