| # Copyright (c) 2017-2019 Red Hat Inc. |
| # Markus Armbruster <armbru@redhat.com> |
| # Marc-André Lureau <marcandre.lureau@redhat.com> |
| # This work is licensed under the terms of the GNU GPL, version 2. |
| # See the COPYING file in the top-level directory. |
| class QAPIError(Exception): |
| def __init__(self, info, col, msg): |
| assert self.info.line is not None |
| return loc + ': ' + self.msg |
| class QAPIParseError(QAPIError): |
| def __init__(self, parser, msg): |
| for ch in parser.src[parser.line_pos:parser.pos]: |
| super().__init__(parser.info, col, msg) |
| class QAPISemError(QAPIError): |
| def __init__(self, info, msg): |
| super().__init__(info, None, msg) |