在部分地方已经有现代 error 风格。 建议统一: 不混用: errno exceptions return code bool 建议统一成: expected<T, process_error> 或者: std::error_code 目标: 所有系统调用失败: 保留 native error 保留上下文 可跨平台映射 例如: spawn failed: pipe creation failed: EMFILE 而不是: spawn failed
在部分地方已经有现代 error 风格。
建议统一:
不混用:
errno
exceptions
return code
bool
建议统一成:
expected<T, process_error>
或者:
std::error_code
目标:
所有系统调用失败:
保留 native error
保留上下文
可跨平台映射
例如:
spawn failed: pipe creation failed: EMFILE
而不是:
spawn failed