[PR #1470] [MERGED] fix(backend): improve error handling in message-list.php sub-process #1537

Closed
opened 2026-02-25 21:38:35 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/cypht-org/cypht/pull/1470
Author: @indridieinarsson
Created: 3/11/2025
Status: Merged
Merged: 3/25/2025
Merged by: @kroky

Base: masterHead: pr_worker_errorhandling


📝 Commits (1)

  • a90153b Improve error handling is sub-processes

📊 Changes

1 file changed (+8 additions, -2 deletions)

View changed files

📝 modules/imap/functions.php (+8 -2)

📄 Description

🍰 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).


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/cypht-org/cypht/pull/1470 **Author:** [@indridieinarsson](https://github.com/indridieinarsson) **Created:** 3/11/2025 **Status:** ✅ Merged **Merged:** 3/25/2025 **Merged by:** [@kroky](https://github.com/kroky) **Base:** `master` ← **Head:** `pr_worker_errorhandling` --- ### 📝 Commits (1) - [`a90153b`](https://github.com/cypht-org/cypht/commit/a90153bff162a0df832d791733d9a4c6855dacf9) Improve error handling is sub-processes ### 📊 Changes **1 file changed** (+8 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `modules/imap/functions.php` (+8 -2) </details> ### 📄 Description ## 🍰 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). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 21:38:35 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/cypht#1537
No description provided.