containerd / ttrpc-rust

Rust implementation of ttrpc (GRPC for low-memory environments)
Apache License 2.0
195 stars 45 forks source link

[windows] Unwrap error as windows error or otherwise return error message #186

Closed jsturtevant closed 1 year ago

jsturtevant commented 1 year ago

When using raw_os_error it will return Some() if it is an OS error otherwise it will return None and the error isn't related to OS failure. This handles it there won't be a panic in the case of a non OS error.

feedback based on https://github.com/containerd/ttrpc-rust/pull/185#discussion_r1176725294. Will need to rebase/update this once #182 #185 merge

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (4661bd1) 24.39% compared to head (57b2713) 24.39%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #186 +/- ## ======================================= Coverage 24.39% 24.39% ======================================= Files 17 17 Lines 2529 2529 ======================================= Hits 617 617 Misses 1912 1912 ``` | [Impacted Files](https://codecov.io/gh/containerd/ttrpc-rust/pull/186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=containerd) | Coverage Δ | | |---|---|---| | [src/error.rs](https://codecov.io/gh/containerd/ttrpc-rust/pull/186?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=containerd#diff-c3JjL2Vycm9yLnJz) | `55.55% <0.00%> (ø)` | |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.