MCPcopy Create free account
hub / github.com/FrameworkComputer/framework-system / print_err_ref

Function print_err_ref

framework_lib/src/chromium_ec/mod.rs:2016–2030  ·  view source on GitHub ↗

Print the error

(something: &EcResult<T>)

Source from the content-addressed store, hash-verified

2014
2015/// Print the error
2016pub fn print_err_ref<T>(something: &EcResult<T>) {
2017 match something {
2018 Ok(_) => {}
2019 // TODO: Some errors we can handle and retry, like Busy, Timeout, InProgress, ...
2020 Err(EcError::Response(status)) => {
2021 error!("EC Response Code: {:?}", status);
2022 }
2023 Err(EcError::UnknownResponseCode(code)) => {
2024 error!("Invalid response code from EC command: {:X}", code);
2025 }
2026 Err(EcError::DeviceError(str)) => {
2027 error!("Failed to communicate with EC. Reason: {:?}", str);
2028 }
2029 }
2030}
2031
2032/// Print the error and turn Result into Option
2033///

Callers 3

get_and_print_power_infoFunction · 0.85
get_and_print_pd_infoFunction · 0.85
print_errFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected