Skip to content

ETag computation silently swallows all exceptions #212

Description

@chedong

描述

phpMan.php ETag 计算中使用了空的 catch (\Throwable $ignored) {},DB 连接失败时异常被完全吞掉。

代码位置

https://github.com/chedong/phpman/blob/master/phpMan.php#L214-L222

try {
    $db = cacheDb();
    // query search_index_updated and emoji_html cache status
    // ...
} catch (\Throwable $ignored) {}

影响

  • DB 故障时完全静默,无日志记录
  • ETag 降级为无缓存时间戳版本,但仍能工作

建议

至少添加 phpManLog() 记录异常信息和上下文。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions