Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Print full startup/initialization error #15569

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/15569.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Print full error and stack-trace of any exception that occurs during startup/initialization.
7 changes: 6 additions & 1 deletion synapse/app/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import sys
import traceback
import warnings
from textwrap import indent
from typing import (
TYPE_CHECKING,
Any,
Expand Down Expand Up @@ -212,8 +213,12 @@ def handle_startup_exception(e: Exception) -> NoReturn:
# Exceptions that occur between setting up the logging and forking or starting
# the reactor are written to the logs, followed by a summary to stderr.
logger.exception("Exception during startup")

error_string = "".join(traceback.format_exception(e))
indented_error_string = indent(error_string, " ")

quit_with_error(
f"Error during initialisation:\n {e}\nThere may be more information in the logs."
f"Error during initialisation:\n{indented_error_string}\nThere may be more information in the logs."
)


Expand Down