Files
revng-revng/python/revng/internal/api/exceptions.py
Giacomo Vercesi 9f63c7c476 revng daemon: handle PipelineManager no init
Handle the case in `revng daemon` where the `PipelineManager` fails to
init. In this scenario the server responds to all requests with a 500
(with the exception of `/` and `/status`, which return 200).
2025-07-30 15:43:02 +02:00

27 lines
722 B
Python

#
# This file is distributed under the MIT License. See LICENSE.md for details.
#
class RevngException(Exception):
pass
class RevngManagerInstantiationException(RevngException):
pass
class RevngDocumentException(RevngException):
def __init__(self, document_error):
self.document_error = document_error
error_text = "Document Error with the following reasons:\n"
for reason in document_error.reasons:
error_text += f"* {reason.message} at {reason.location}\n"
super().__init__(error_text)
class RevngSimpleException(RevngException):
def __init__(self, simple_error):
self.simple_error = simple_error
super().__init__(simple_error.message)