Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(backend): improve error handling in message-list.php sub-process #1470

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

indridieinarsson
Copy link
Contributor

🍰 Pullrequest

PR #1452 introduced a separate process for concurrently loading messages. In my use case, where cypht runs standalone in a docker container (compiled using the official cypht Dockerfile), most error messages and exceptions leave no traces in the logs, even if using the development versions of php.ini (also supplied by the base docker image). This makes it very hard to debug if things go wrong in message_list.php

This PR tries to remedy this by wrapping the entire contents of message_list.php in a try/catch clause, and then piping the resulting error messages to the parent process via stderr. This way, errors in the subprocess leave understandable log entries.

According to my (admittedly quite limited) research, there are negligible performance implications of wrapping the code in a try block, as long as no exceptions are thrown (performance hit of try/catch is supposed to be only due to the cost of handling the exception).

@indridieinarsson indridieinarsson changed the title fix(backend): improve error handling is message-list sub-process fix(backend): improve error handling in message-list.php sub-process Mar 12, 2025
@indridieinarsson indridieinarsson force-pushed the pr_worker_errorhandling branch from 7f47326 to d505011 Compare March 12, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant