fix: review comments

This commit is contained in:
Volodymyr Yavdoshenko 2025-05-08 14:27:08 +03:00
parent 61fe1ff944
commit a9b7be3c0e
No known key found for this signature in database
GPG key ID: 24BC74845F4F4064

View file

@ -363,16 +363,7 @@ GenericError ExecutionState::GetError() const {
} }
void ExecutionState::ReportCancelError() { void ExecutionState::ReportCancelError() {
std::string cancel_reason = "ExecutionState cancelled"; ReportError(std::make_error_code(errc::operation_canceled), "ExecutionState cancelled");
// Add additional information about the reason for cancellation, if possible
// Possible to extract from system errors or context
std::error_code sys_err = std::error_code(errno, std::system_category());
if (sys_err && sys_err != std::errc::operation_canceled) {
absl::StrAppend(&cancel_reason, " due to system error: ", sys_err.message());
}
ReportError(std::make_error_code(errc::operation_canceled), cancel_reason);
} }
void ExecutionState::Reset(ErrHandler handler) { void ExecutionState::Reset(ErrHandler handler) {